SA-MP Forums Archive
need command: PM - 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: need command: PM (/showthread.php?tid=257653)



need command: PM - mariomako - 27.05.2011

I need command /PM or /Personal Message to send a private message to player


Re: need command: PM - Mean - 27.05.2011

SSCANF + ZCMD ( you can use dcmd if you really want to, just change the macro )
pawn Код:
CMD:pm( playerid, params[ ] )
{
    new
        id,
        msg[ 128 ]
    ;
    if( sscanf( params, "us[128]", id, msg ) )
        return SendClientMessage( playerid, -1, "USAGE: /pm [ID] [Message]. " );
    if( id == INVALID_PLAYER_ID )
        return SendClientMessage( playerid, -1, "Invalid ID!" );
    new
        string[ 128 ],
        pName[ 24 ],
        rName[ 24 ]
    ;
    GetPlayerName( playerid, pName, 24 );
    GetPlayerName( id, rName, 24 );
    format( string, sizeof string, "PM from %s[%d]: %s", pName, playerid, msg );
    SendClientMessage( id, -1, string );
    format( string, sizeof string, "PM to %s[%d]: %s", rName, id, msg );
    SendClientMessage( playerid, -1, string );
    return 1;
}
Change the colors, -1 is white.


Re: need command: PM - Elka_Blazer - 27.05.2011

Ur using sscanf/strtok?