SA-MP Forums Archive
How to make command ''pm'' trough zcmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make command ''pm'' trough zcmd (/showthread.php?tid=186892)



How to make command ''pm'' trough zcmd - [WSF]ThA_Devil - 31.10.2010

CMDm(playerid, params[]) {
if(isnull(params)) {
SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm [ID/Part of name] [Text]");
} else {
// i need help what to write here!
return 1;
}


Re: How to make command ''pm'' trough zcmd - [L3th4l] - 31.10.2010

sscanf2 + zcmd

pawn Код:
CMD:pm(playerid, params[])
{
    new PID, pName[MAX_PLAYER_NAME], Sender[MAX_PLAYER_NAME];
    if(sscanf(params, "us[128]", PID, params)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /PM < PlayerID > < Message >");
    if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, 0xFF0000FF, "That user is not connected!");
    new Str[128];

    GetPlayerName(PID, pName, sizeof(pName));
    GetPlayerName(playerid, Sender, sizeof(Sender));

    format(Str, sizeof(Str), "PM From: %s(%d): %s", Sender, playerid, params);
    SendClientMessage(PID, 0xFF0000FF, Str);
 
    format(Str, sizeof(Str), "PM Sent To: %s(%d): %s", pName, PID, params);
    SendClientMessage(playerid, 0xFF0000FF, Str);
    return 1;
}
You might get some errors + warnings ( i'm sleepy )


Re: How to make command ''pm'' trough zcmd - [WSF]ThA_Devil - 31.10.2010

ok thanks anyway...


Re: How to make command ''pm'' trough zcmd - [WSF]ThA_Devil - 31.10.2010

yea it worked... no errors and no warnings! thanx!