24.01.2014, 10:20
I got a problem that when i use any command that i must write the full usage of the command
Example
It tells me **USAGE: /adkill (Player Name/ID) (Reason)
Example
pawn Код:
dcmd_adkill(playerid,params[])
{
new string[128];
new ID;
new cmdreason[100];
if(sscanf(params,"us[100]",ID,cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"**USAGE: /adkill (Player Name/ID) (Reason)");
SendClientMessage(playerid,COLOR_LIME,"It will Kill the player");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot kill them.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsKidnapped[playerid] != 0)
{
SendClientMessage(playerid,COLOR_ERROR,"**You are Kidnaped you can't use this command");
return 1;
}
format(string,sizeof(string),"%s has killed %s(%d) for reason: %s.",PlayerName(playerid),PlayerName(ID),ID,cmdreason);
SendClientMessageToAll(COLOR_ADMIN,string);
format(string,sizeof(string),"[ADMIN-COMMAND] %s(%d) has used /adkill on %s(%d)",PlayerName(playerid),playerid,PlayerName(ID),ID);
SendClientMessageToAllAdmins(string);
SetPlayerHealth(ID,0);
return 1;
}