need command: PM
#1

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

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.
Reply
#3

Ur using sscanf/strtok?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)