pm Command
#6

Oh god, here is an example using y_commands and sscanf2:

pawn Код:
YCMD:pm(playerid, params[], help)
{
    if ( help ) return SendClientMessage( playerid, -1, #Send a private message );
    if ( sscanf ( params, "rs[128]", params[ 0 ], params[ 1 ] ) ) return SendClientMessage( playerid, -1, #Syntax /pm <playername/id> <text> );
    if ( params[ 0 ] == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, #Player offline );
    new
        _string[ 128 ], _sendername[ MAX_PLAYER_NAME ], _targetname[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, _sendername, MAX_PLAYER_NAME ); GetPlayerName( params[ 0 ], _targetname, MAX_PLAYER_NAME );
    format( _string, sizeof ( _string ), "*PM sent to %s(%d): %s", _targetname, params[ 0 ], params[ 1 ] );
    SendClientMessage( playerid, -1, _string );
    format( _string, sizeof ( _string ), "*PM recieved from %s(%d): %s", _sendername, playerid, params[ 1 ] );
    SendClientMessage( params[ 0 ], -1, _string );
    return ( true );
}
Reply


Messages In This Thread
pm Command - by [GTA]Leon[RPD] - 04.11.2011, 16:57
Re: pm Command - by [MG]Dimi - 04.11.2011, 17:09
Re: pm Command - by =WoR=G4M3Ov3r - 04.11.2011, 17:09
Re: pm Command - by [GTA]Leon[RPD] - 04.11.2011, 17:30
Re: pm Command - by [GTA]Leon[RPD] - 04.11.2011, 18:04
Re: pm Command - by SmiT - 04.11.2011, 18:12
Re: pm Command - by [GTA]Leon[RPD] - 04.11.2011, 18:17
Re: pm Command - by SmiT - 04.11.2011, 18:18
Re: pm Command - by [GTA]Leon[RPD] - 04.11.2011, 18:23
Re: pm Command - by [GTA]Leon[RPD] - 05.11.2011, 03:25

Forum Jump:


Users browsing this thread: 1 Guest(s)