16.06.2011, 14:27
pawn Код:
stock getpName( playerid )
{
new pName[ 24 ];
GetPlayerName( playerid, pName, sizeof pName );
return pName;
}
// PM Command ( ZCMD + SSCANF )
CMD:pm( playerid, params[ ] )
{
new targetid, msg[ 128 ];
if ( sscanf( params, "us[128]", targetid, msg ) )
return SendClientMessage( playerid, 0xFFFFFFAA, "Correct Usage: /PM < Playerid/PartOfName > < MSG >." );
if ( !IsPlayerConnected( targetid ) )
return SendClientMessage( playerid, 0xFFFFFFAA, "Invalid player." );
if ( targetid == playerid )
return SendClientMessage( playerid, 0xFFFFFFAA, "You cannot PM yourself." );
new szstring[ 128 ];
format( szstring, sizeof szstring, ">>PM Sent to %s ( %d ) : %s.", getpName( targetid ), targetid, msg );
SendClientMessage( playerid, 0x00FF00AA, szstring );
format( szstring, sizeof szstring, ">>PM from %s( %d ) : %s.", getpName( playerid ), playerid, msg );
SendClientMessage( playerid, 0x00FF00AA, szstring );
return 1;
}
// Carcolor command ( ZCMD + SSCANF )
CMD:cc( playerid, params[ ] )
{
new color1, color2;
if ( !IsPlayerInAnyVehicle( playerid ) )
return SendClientMessage( playerid, 0xFFFFFFAA, "You are not in any vehicles." );
if ( sscanf( params, "ii", color1, color2 ) )
return SendClientMessage( playerid, 0xFFFFFFAA, "/cc < color1 > < color2 >" );
ChangeVehicleColour( GetPlayerVehicleID( playerid ), color1, color2 );
return 1;
}