27.05.2011, 08:16
SSCANF + ZCMD ( you can use dcmd if you really want to, just change the macro )
Change the colors, -1 is white.
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;
}