Skins
#5

Quote:
Originally Posted by Darkwood17
Посмотреть сообщение
Maybe you have limited the command. Show us the code.
PHP код:
stock IsInvalidSkin(skin)
{
    
#define    MAX_BAD_SKINS   15
    
new badSkins[MAX_BAD_SKINS] =
    {
        
13456842657486,
        
119149208273289
    
};
    for (new 
0MAX_BAD_SKINSi++)
    {
        if (
skin == badSkins[i] || skin || skin >= 300 ) return true;
    }
    return 
false;

/setskin cmd:
PHP код:
CMD:setskin(playeridparams[])
{
    if (
PlayerInfo[playerid][pAdmin] >= 3)
    {
        new 
string[128], giveplayeridskinid;
        if(
sscanf(params"id"giveplayeridskinid)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /setskin [playerid] [skinid]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if(!
IsInvalidSkin(skinid))
            {
                if(
GetPlayerSkin(giveplayerid) == skinid)
                {
                    
SendClientMessageExplayeridCOLOR_WHITE"The player you're trying to change skins of already is using the skin you're trying to set." );
                }
                else
                {
                    
PlayerInfo[giveplayerid][pChar] = skinid;
                    
PlayerInfo[giveplayerid][pModel] = skinid;
                    
format(stringsizeof(string), "Your skin has been changed to ID %d by Administrator %s."skinidGetPlayerNameEx(playerid));
                    
SendClientMessageEx(giveplayeridCOLOR_WHITEstring);
                    
format(stringsizeof(string), "You have given %s skin ID %d."GetPlayerNameEx(giveplayerid), skinid);
                    
SendClientMessageEx(playeridCOLOR_WHITEstring);
                    
SetPlayerSkin(giveplayeridPlayerInfo[giveplayerid][pChar]);
                }
            }
            else
            {
                
SendClientMessageEx(playeridCOLOR_GREY"Invalid skin ID!");
            }
        }
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command!");
    }
    return 
1;

i have added some bad skins so that player cant set that skins but, i havent added new 0.3.7 skins in bad skins list then too, IG it says Invalid Skin ID! ?

EDIT: i have edited now some thing in IsAValidSkin so lets hope it works!
Reply


Messages In This Thread
Skins - by GeorgeMcReary - 14.06.2015, 17:15
Re: Skins - by DarkLored - 14.06.2015, 17:21
Re: Skins - by GeorgeMcReary - 14.06.2015, 17:28
Re: Skins - by Darkwood17 - 14.06.2015, 17:30
Re: Skins - by GeorgeMcReary - 14.06.2015, 17:37
Re: Skins - by Darkwood17 - 14.06.2015, 17:40
Re: Skins - by Metharon - 14.06.2015, 17:41
Re: Skins - by GeorgeMcReary - 14.06.2015, 17:46

Forum Jump:


Users browsing this thread: 1 Guest(s)