/pm command problem
#3

I assume you're using the sscanf stock instead of the plugin (the plugin is too much time to set up so I use the stock too xD).
Anyway, try this instead:

pawn Код:
CMD:pm(playerid, params[])
{
    new pID, Msg[128];
    if(sscanf(params, "ds", pID, Msg)) return SendClientMessage(playerid, -1, "USAGE: /pm [PlayerID] [Message]");
    if(pID == playerid) return SendClientMessage(playerid, 0xFF0000FF, "You can't PM to yourself!");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xFF0000FF, "Invalid PlayerID or the PlayerID is not online!");
    if(GetPVarInt(playerid, "PMEnabled") == 0) return GameTextForPlayer(playerid, "~n~~n~~r~Player Disabled PM", 3000, 5);
    new str[256], pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(pID, pName2, sizeof(pName2));
    format(str, sizeof(str), "PM Sent to %s (ID: %d): %s", pName2, pID, Msg);
    SendClientMessage(playerid, -1, str);
    format(str, sizeof(str), "PM from %s (ID: %d): %s", pName, playerid, Msg);
    SendClientMessage(pID, -1, str);
    return 1;
}
gedgfgsd
Reply


Messages In This Thread
/pm command problem - by kbalor - 29.07.2012, 10:43
Re: /pm command problem - by kbalor - 29.07.2012, 14:28
Re: /pm command problem - by Emmet_ - 29.07.2012, 14:31
Re: /pm command problem - by [MM]RoXoR[FS] - 29.07.2012, 14:33
Re: /pm command problem - by kbalor - 29.07.2012, 14:41
Re: /pm command problem - by Pravin - 29.07.2012, 16:08

Forum Jump:


Users browsing this thread: 1 Guest(s)