Slap Command
#21

add this at the end of your script

pawn Code:
stock GetName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
        GetPlayerName(playerid, Name, sizeof(Name));
    }
    return Name;
}
EDIT: didn't noticed that @vince already told u
Reply
#22

HTML Code:
<<<@!1!@>>>
Reply
#23

Under onplayercommandtext
PHP Code:
dcmd(slap4cmdtext); 
ANd this is the code!

Code:
dcmd_slap(playerid, params[])
{
    new id, string[126], Float: PPos[3];
    if(sscanf(params, "u", id))
        return SendClientMessage(playerid, -1, "SYNTAX: /slap [id]");
    
    GetPlayerPos(id, PPos[0], PPos[1], PPos[2]);
    SetPlayerPos(id, PPos[0], PPos[1], PPos[2]+4);
    
    format(string, sizeof(string), "You have slapped %s", GetName(id));
    SendClientMessage(playerid, -1, string);
    return 1;
}
And add this somewhere last!
PHP Code:
stock GetName(playerid)
{
    new 
Name[MAX_PLAYER_NAME];
    if(
IsPlayerConnected(playerid))
    {
        
GetPlayerName(playeridNamesizeof(Name));
    }
    return 
Name;

Salute Indian, i'm also indian!If worked , rep me bro!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)