[Help]Slap CMD
#3

params[0] isn't going to actually return their player id, it's in string format. You will need to use strval(params).
pawn Код:
CMD:slap(playerid, params[])
{
    new id = strval(params);
    new message[128];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOPE!");
    new Float:x, Float:y, Float:z;
    if(!params[0])) return SendClientMessage(playerid, 0xFFFFFFFFAA, "USAGE: /slap [playerid]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_WHITE, "SERVER: Wrong ID / player has just quit.");
    GetPlayerPos(id, x, y, z);
    SetPlayerPos(id, x, y, z+5);
    PlayerPlaySound(id, 1130, x, y, z+5);
    format(message, sizeof(message),""COL_RED"[AdmSlap]: "COL_WHITE"%s was slapped by %s.",GetName(id),     GetName(playerid));
    SendClientMessageToAll(COLOR_WHITE, message);
    return 1;
}
Reply


Messages In This Thread
[Help]Slap CMD - by xRandomGuy - 12.12.2011, 23:16
Re: [Help]Slap CMD - by Storm203 - 13.12.2011, 00:16
Re: [Help]Slap CMD - by [HiC]TheKiller - 13.12.2011, 00:57
Re: [Help]Slap CMD - by grand.Theft.Otto - 13.12.2011, 01:00
Re: [Help]Slap CMD - by xRandomGuy - 13.12.2011, 01:51
Re: [Help]Slap CMD - by SomebodyAndMe - 13.12.2011, 05:28
Re: [Help]Slap CMD - by suhrab_mujeeb - 13.12.2011, 07:13
Re: [Help]Slap CMD - by SomebodyAndMe - 13.12.2011, 07:34
Re: [Help]Slap CMD - by shitbird - 13.12.2011, 10:07
Re: [Help]Slap CMD - by grand.Theft.Otto - 13.12.2011, 14:24

Forum Jump:


Users browsing this thread: 1 Guest(s)