24.12.2011, 20:09
So I'm new to PAWN, and I'm just tinkering around with commands. I made a command called ''/cop'' that gives you a cop skin, refills your armour and health, and and gives you a deagle. So I got the command to work, but when ever I type it IG I see this.
I have no idea where that ''SERVER: Uknown Command" is coming from. All I do is type ''/cop'' once and it returns the ''You are now a cop!'' message as well as the Unknown Command Message.
Here is my code.
/---------------------------------------------------------------------------------------------------------------------------------------------------\
/---------------------------------------------------------------------------------------------------------------------------------------------------\
Another thing, I was also trying to make this an Admin only command, but whenever I type ANY command I just get the ''You are not an Admin'' message. Same code was used above. Thank you.
I have no idea where that ''SERVER: Uknown Command" is coming from. All I do is type ''/cop'' once and it returns the ''You are now a cop!'' message as well as the Unknown Command Message.
Here is my code.
pawn Код:
if(strcmp("/cop", cmdtext, true, 10) ==0)
{
IsPlayerAdmin(playerid)
{
SendClientMessage(playerid, 0x80FFFFFF, "You are now a cop!");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 24, 9999);
SetPlayerSkin(playerid, 280);
}
}
else {
{
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0xFF0000FF, "You are not an Admin!")
}
}
return 1;
}
return 0;
}
/---------------------------------------------------------------------------------------------------------------------------------------------------\
Another thing, I was also trying to make this an Admin only command, but whenever I type ANY command I just get the ''You are not an Admin'' message. Same code was used above. Thank you.