27.12.2012, 05:53
Quote:
This should work:
pawn Код:
|
This will:
pawn Код:
CMD:jetpack(playerid, params[])
{
new targetidname[MAX_PLAYER_NAME],targetid; new string[256];
if(PlayerInfo[playerid][pAdmin] >= 2)
{
if(IsPlayerConnected(playerid))
{
if(!sscanf(params,"u",targetid))
{
GetPlayerName(targetid, targetidname, sizeof(targetidname));
format(string,sizeof(string),"An administrator has given a jetpack to %s", targetidname);
SendClientMessageToAll(-1, string);
GivePlayerJetpack(targetid);
}
else return SendClientMessage(playerid,1,"Usage: /jetpack (ID/Name);");
}
}
else return SendClientMessage(playerid, "You're not an Administrator Level 2");
return 1;
}
This will help him:
1-Missing closing brackets
2-You had a else if without and if statement above
3-Your returning messages would not do anything
4-GetPlayerName missed something
5-Forgot a closing ) after IsPlayerConnected
6-Where sscanf check the intered text, it would be inversed
EDIT:The man above me was faster, but anyways. Your last change, "GivePlayerJetpack" removed, maybe he has a function for it where it sets the special action in