Optinal multi params command using sscanf
#9

pawn Код:
CMD:slap( playerid, params[ ] )
{
    new ID,string[128],reason[66],Name[MAX_PLAYER_NAME],IdName[MAX_PLAYER_NAME],Float:x,Float:y,Float:z,Float:Health;
    if(sscanf(params, "uS(Not Specified)[65]", ID, reason)) return SendClientMessage(playerid, -1, "USAGE: /slap [PlayerID] [Reason]");
    else if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[*] Enter a valid player ID/name!");
    GetPlayerName(playerid, Name, sizeof(Name));
    GetPlayerName(ID, IdName, sizeof(IdName));
    GetPlayerHealth(ID,Health);
    SetPlayerHealth(ID,Health-25);
    GetPlayerPos(ID,x,y,z);
    SetPlayerPos(ID,x,y,z+5);
    PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
    PlayerPlaySound(ID,1190,0.0,0.0,0.0);
    format(string,sizeof(string),"You have been Slapped by Administrator %s | Reason: %s",IdName,reason);
    SendClientMessage(ID,-1,string);
    format(string,sizeof(string),"You have slapped %s | Reason: %s",IdName,reason);
    SendClientMessage(playerid,-1,string);
    return 1;
}
Reply


Messages In This Thread
Optinal multi params command using sscanf - by Kyro - 12.03.2011, 12:26
Re: Optinal multi params command using sscanf - by JamesC - 12.03.2011, 12:28
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 12:34
Re: Optinal multi params command using sscanf - by JamesC - 12.03.2011, 12:46
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 12:52
Re: Optinal multi params command using sscanf - by JamesC - 12.03.2011, 12:56
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 13:12
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 13:41
Re: Optinal multi params command using sscanf - by HyperZ - 12.03.2011, 14:08
Re: Optinal multi params command using sscanf - by Kyro - 12.03.2011, 14:15

Forum Jump:


Users browsing this thread: 3 Guest(s)