15.09.2012, 17:50
(
Последний раз редактировалось Ronaldo_raul™; 15.09.2012 в 18:29.
)
pawn Код:
CMD:setskin ( playerid , params [] )
{
new ID , sID ;
if ( sscanf ( params , "ui" , ID , sID ) ) return SendClientMessage ( playerid , 0xFFFFFFF , "Syntax error.Correct usage: /setskin [PlayerID] [Skinmodel]" ) ;
if ( !IsPlayerAdmin ( playerid ) ) return SendClientMessage ( playerid , 0xFFFFFFF , "This command is only for RCON Admins." ) ;
if ( sID > 299 || sID < 1 ) return SendClientMessage ( playerid , 0xFFFFFFF , "Wrong Skin ID! Available ID's: 1-299" ) ;
if ( !IsPlayerConnected ( ID ) ) return SendClientMessage ( playerid , 0xFFFFFFF , "That player is not connected to your server" ) ;
else
{
new tName [ MAX_PLAYER_NAME ] , aName [ MAX_PLAYER_NAME ] , Str [ 128 ] ;
GetPlayerName ( playerid , aName , sizeof ( aName ) ) ;
GetPlayerName ( ID , tName , sizeof ( tName ) ) ;
format ( Str , 128 , "Your skin have been set to model %d by admin %s" , sID , aName ) ;
SendClientMessage ( ID , 0xFFFFFF , Str ) ;
format ( Str , 128 , "You have set %s skin to model %d" , tName , ID ) ;
SendClientMessage ( playerid , 0xFFFFFF , Str ) ;
SetPlayerSkin ( ID , sID ) ; // This will set the target the skin ID the sender want to
}
return 1 ;
}
EDIT: Forgot to change the skin to sID.