27.07.2012, 21:53
PHP код:
dcmd_pm(playerid,params[])
{
if(GetPVarInt(id,"NoPM") == 0)
{
new id,string[256],pName[MAX_PLAYER_NAME],pName2[MAX_PLAYER_NAME], pMessage;
if( sscanf( params, "us[126]" id, pMessage )) return SendClientMessage( playerid, -1, "Usage: /pm [ID] (message)" );
if( id == playerid ) return SendClientMessage( playerid, -1, "You cant PM yourselfe!");
if( IsPlayerConnected( id )
{
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(id, pName2, sizeof(pName2));
format(string, sizeof( string ), "PM From %s(%d): %s", pName, playerid, pMessage);
SendClientMessage(id, -1, string);
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
format(string, sizeof( string ), "PM To %s(%d): %s", pName2, id, pMessage);
SendClientMessage(playerid, -1, string);
SetPVarInt(id,"LastID",playerid);
}else return SendClientMessage(playerid, -1, "That player is not connected!");
else
{
SendClientMessage(playerid, COLOR_ERROR,"ERROR: Currently, that player's PM is set to: OFF!");
PlayerPlaySound(playerid, 1053, 0.0, 0.0, 0.0);
}
return 1;
}