Slap command help
#6

First of all you have to get the name of the player you slapped so you have to make it like this:
pawn Код:
GetPlayerName(id, string, 21);
Instead of:
pawn Код:
GetPlayerName(playerid, string, 21);
So it will be like this:
pawn Код:
CMD:slap(playerid, params[])
{
    if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid, 0xF69521AA, "You can't use this command!");//Checking if the player has admin level 1, if not it sends him a message.
    new id, reason[100];
    if(sscanf(params,"us[100]",id, reason)) return SendClientMessage(playerid, 0xa10000,"USAGE: /slap [playerid/partofname] [reason]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xF69521AA,"The specified player is currently not connected!");//Checking if the selected user is connected or not.

    new string[128], Float: PPos[3];
    GetPlayerPos(id, PPos[0], PPos[1], PPos[2]);
    SetPlayerPos(id, PPos[0], PPos[1], PPos[2]+4);

    GetPlayerName(id, string, 21);
    format(string, sizeof(string), "You have successfully slapped %s! || %s", string, reason);
    SendClientMessage(playerid, 0xF69521AA, string);
    return 1;
}
Reply


Messages In This Thread
Slap command help - by Vasu99 - 03.03.2014, 19:09
Re: Slap command help - by Aerotactics - 03.03.2014, 19:14
Re: Slap command help - by Vasu99 - 03.03.2014, 19:16
Re: Slap command help - by PrivatioBoni - 03.03.2014, 19:42
Re: Slap command help - by BKarner - 03.03.2014, 19:45
Re: Slap command help - by Nurgle4 - 03.03.2014, 20:08

Forum Jump:


Users browsing this thread: 2 Guest(s)