can someone give me pm
#4

Better start learning ZCMD and sscanf now

pawn Код:
CMD:pm(playerid, params[])
{
    new PID, reason[35], pName[MAX_PLAYER_NAME], Sender[MAX_PLAYER_NAME];
    if(sscanf(params, "uz", PID, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /PM < PlayerID > < Message >");
    if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, 0xFF0000FF, "That user is not connected!");
    else
    {
    new Str[128];
    GetPlayerName(PID, pName, sizeof(pName));
    GetPlayerName(playerid, Sender, sizeof(Sender));
    format(Str, sizeof(Str), "PM From: %s(%d): %s", Sender, playerid, reason);
    SendClientMessage(PID, COLOR_YELLOW, Str);
    format(Str, sizeof(Str), "PM To: %s(%d): %s", pName, PID, reason);
    SendClientMessage(playerid, COLOR_YELLOW, Str);
    }
    return 1;
}
Reply


Messages In This Thread
can someone give me pm - by DerickClark - 10.12.2012, 22:18
Re: can someone give me pm - by Ironboy - 10.12.2012, 22:32
Re: can someone give me pm - by DerickClark - 10.12.2012, 23:10
Re: can someone give me pm - by dannyk0ed - 11.12.2012, 00:34
Re: can someone give me pm - by DerickClark - 11.12.2012, 00:40
Re: can someone give me pm - by Steven82 - 11.12.2012, 00:43

Forum Jump:


Users browsing this thread: 2 Guest(s)