PDA

View Full Version : Help about DM script Please read


KINGINA
05/04/2012, 07:25 PM
Here i'm going to make DM script for my server, a make map, cmd for tp, but when some players who have slow PC type cmd they fall down under object where need to spawn, and i need to have when player type /dm1 to freeze him I have this script
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/dm1", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 1712.4000488281,-1086.8,2638.9);
SendClientMessage(playerid, 0x32CD32AA, "Welcome to KINGINA's Map, Try to survive, Type /dminfo for info and /reclass to leave DM");
GivePlayerWeapon(playerid, 27, 10000);//combat shotgun
GivePlayerWeapon(playerid, 31, 10000);//m4
GivePlayerWeapon(playerid, 29, 10000);//mp5
GivePlayerWeapon(playerid, 24, 10000);//deagle
GivePlayerWeapon(playerid, 34, 10000);//sniper
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{00ff00} %s has teleported to the deathmach arena!!!! (Type /dm1 to join him!!!) ", pname);
SendClientMessageToAll(playerid, string);

Can anyone say how to make to player greeze to objects can load
And 1 more thing. Where to put when player kill someone to he get money

rep + if you help me (without error)

ViniBorn
05/04/2012, 07:31 PM
You need to freeze the player, and then unfreeze

KINGINA
05/04/2012, 07:35 PM
yea i know thet 2 but still need code.

RenSoprano
05/04/2012, 07:36 PM
This is for money

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/dm1", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 1712.4000488281,-1086.8,2638.9);
SendClientMessage(playerid, 0x32CD32AA, "Welcome to KINGINA's Map, Try to survive, Type /dminfo for info and /reclass to leave DM");
GivePlayerWeapon(playerid, 27, 10000);//combat shotgun
GivePlayerWeapon(playerid, 31, 10000);//m4
GivePlayerWeapon(playerid, 29, 10000);//mp5
GivePlayerWeapon(playerid, 24, 10000);//deagle
GivePlayerWeapon(playerid, 34, 10000);//sniper
GivePlayerMoney(killerrid, 1500) // You can change 1500 with your price what you want.
}

new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{00ff00} %s has teleported to the deathmach arena!!!! (Type /dm1 to join him!!!) ", pname);
SendClientMessageToAll(playerid, string);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason) //This code gets called when somebody dies.
{
if(IsPlayerConnected(killerid)) //Checks if there really is a "killer" - more ways of death are for example falling from great heights, so there isn't a killer there!
{
GivePlayerMoney(killerid, 1500); //Give the player 1500 dollars
}
return 1;
}

ViniBorn
05/04/2012, 07:40 PM
Just use TogglePlayerControllable (http://wiki.sa-mp.com/wiki/TogglePlayerControllable) and SetTimerEx (http://wiki.sa-mp.com/wiki/SetTimerEx)

KINGINA
05/04/2012, 07:45 PM
Thanks to all :)