Slap command help
#5

This is what I mean, this should not have any errors in it, but if there are let me know:

pawn Код:
CMD:slap(playerid, params[])
{    
    new id, string[128], Float: PPos[3], reason[128];    
    if(PlayerInfo[playerid][Level] < 1)
    {
        SendClientMessage(playerid, 0xF69521AA, "You can't use this command!");//Checking if the player has admin level 1, if not it sends him a message.
        return 1;
    }
    if(sscanf(params,"us[128]",id, reason))
    {
        SendClientMessage(playerid, 0xa10000,"USAGE: /slap [playerid/partofname] [reason]");
        return 1;      
    }    
    if(!IsPlayerConnected(id))
    {
        SendClientMessage(playerid, 0xF69521AA,"The specified player is currently not connected!");//Checking if the selected user is connected or not.  
        return 1;
    }
    new GetNameVar[MAX_PLAYER_NAME];//Your main error was on this line, you forgot the ";"
    GetPlayerPos(id, PPos[0], PPos[1], PPos[2]);    
    SetPlayerPos(id, PPos[0], PPos[1], PPos[2]+4);        
    GetPlayerName(playerid, GetNameVar, sizeof(GetNameVar));    
    format(string, sizeof(string), "You have successfully slapped %s!", GetNameVar(id));    
    SendClientMessage(playerid, -1, string);    
    return 1;
}
Reply


Messages In This Thread
Slap command help - by Vasu99 - 02.03.2014, 18:58
Re: Slap command help - by Brandon_More - 02.03.2014, 19:01
Re: Slap command help - by jakejohnsonusa - 02.03.2014, 19:05
Re: Slap command help - by Vasu99 - 02.03.2014, 19:10
Re: Slap command help - by jakejohnsonusa - 02.03.2014, 19:16
Re: Slap command help - by Vasu99 - 02.03.2014, 19:18
Re: Slap command help - by Konstantinos - 02.03.2014, 19:41
Re: Slap command help - by jakejohnsonusa - 02.03.2014, 19:42
Re: Slap command help - by Vasu99 - 02.03.2014, 19:42
AW: Slap command help - by ZaakWest - 02.03.2014, 19:44

Forum Jump:


Users browsing this thread: 4 Guest(s)