ID bug
#6

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 ;
}
This should work, Haven't tested though.

EDIT: Forgot to change the skin to sID.
Reply


Messages In This Thread
ID bug - by xMCx - 15.09.2012, 16:55
Re: ID bug - by Sig Hansen - 15.09.2012, 17:02
Re: ID bug - by xMCx - 15.09.2012, 17:31
Re: ID bug - by Sig Hansen - 15.09.2012, 17:33
Re: ID bug - by xMCx - 15.09.2012, 17:42
Re: ID bug - by Ronaldo_raul™ - 15.09.2012, 17:50
Re: ID bug - by xMCx - 15.09.2012, 18:05
Re: ID bug - by Ronaldo_raul™ - 15.09.2012, 18:30
Re: ID bug - by xMCx - 15.09.2012, 18:38
Re: ID bug - by TheBlackKnight - 15.09.2012, 18:41

Forum Jump:


Users browsing this thread: 1 Guest(s)