22.09.2009, 12:46
Maybe try using stock instead of public, or just copy the whole function itself to the command, should work.
pawn Код:
if(strcmp(cmdtext, "/ltkdm", true) == 0) { //Don't join with armour because of the bugged headshot script.
new pName[MAX_PLAYER_NAME];
new string[256];
new rand = random(sizeof(gRandomPlayerSpawns));
SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]);
ShowPlayerMarkers(0);
ResetPlayerWeapons(playerid);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 2);
SetPlayerArmour(playerid, 0.0); //This is needed so players can't join with armour.
SetPlayerHealth(playerid, 5); //This activates the Licence To Kill mode. This means one-hit-kill.
GivePlayerWeapon(playerid, 23, 500); //Silenced pistol.
ResetPlayerMoney(playerid);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s has joined the Licence To Kill deathmatch. Use /ltkdm to join.", pName);
SendClientMessageToAll(0xFFFF00AA, string);
SendClientMessage(playerid, red, "-------------------------------------------------------------------------------------");
SendClientMessage(playerid, green, "Welcome to the Licence To Kill deathmatch. Kill your enemies before they kill you.");
SendClientMessage(playerid, green, "Remember, Licence To Kill means one shot to kill. Your only weapon is the silenced pistol.");
SendClientMessage(playerid, COLOR_GREEN1, "Type /mainworld if you are done with dm'ing. This resets your weapons though.");
SendClientMessage(playerid, red, "-------------------------------------------------------------------------------------");
return 1;
}

