29.11.2009, 11:38
Quote:
Originally Posted by ImRico
Great!
If i want to make it for only 1337 admins it should be like this? : if(strcmp(cmdtext, "/duel") == 1337) { new name[24]; GetPlayerName(playerid,name,24); SetPlayerPos(playerid, 1394.4448, 2159.5742, 9.7578,89.3516); format(string,sizeof(string),"%s has just typed /duel!",name); SendPlayerFormattedText(playerid,"Welcome to dueling arena", 0); GameTextForPlayer(playerid,"~w~Welcome to ~r~/Duel.",5000,5); SendClientMessageToAll(0xFFFFFFFF,string); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 26, 500); GivePlayerWeapon(playerid, 32, 500); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); return 1; } |
You must define COLOR_GRAD and COLOR_WHITE.
pawn Код:
if(strcmp(cmdtext, "/duel") == 0)
{
if(PlayerInfo[playerid][pAdmin] != 1337) return SendClientMessage(playerid, COLOR_GRAD, "Only 1337 admin levels can use this command!");
new name[24];
GetPlayerName(playerid,name,24);
SetPlayerPos(playerid, 1394.4448, 2159.5742, 9.7578,89.3516);
format(string,sizeof(string),"%s has just typed /duel!",name);
SendClientMessageToAll(COLOR_WHITE,string);
SendClientMessage(playerid, COLOR_WHITE, "Welcome to duel arena!");
GameTextForPlayer(playerid,"~w~Welcome to ~r~/duel.",5000,5);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 26, 500);
GivePlayerWeapon(playerid, 32, 500);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
return 1;
}
@ABCitrus:
First, you don't need to create a topic for just one simple cmd.
Second, you are using SendPlayerFormattedText, and you didn't give the code of that function.
Third, you could indentify script.