27.05.2011, 08:00
I need command /PM or /Personal Message to send a private message to player
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;
}