/skin command doesn't work
#1

It always says "You cannot use this Skin!":

Код:
CMD:skin(playerid,params[])
{
       new skinid, string[128];
       if(sscanf(params, "d", skinid)) return SendClientMessage(playerid, /skin skinid");
       if(skinid < 1 || skinid > 299) return SendClientMessage(playerid,"Skin ID must be between 1 and 299!");
       if(skinid > 162 || skinid < 217) return SendClientMessage(playerid,"You cannot use this Skin!");
       SetPlayerSkin(playerid, skinid);
       SendClientMessage(playerid,"Skin changed");
    return 1;
}
Reply
#2

replace :

PHP код:
if(skinid 162 || skinid 217
to :

PHP код:
if(skinid 162 && skinid 217
Reply
#3

After 1 " if " use " else if " and at " else " , and your last sendclientmessage is wrong , you didn't use any color
Reply
#4

if(skinid > 162 || skinid < 217) this code doesnt allow you to use skins ids higher than 162 or lower than 217 so i don't know why are you using it. If you want the play not to use the certain skin ids 162 / 217 you should do this.

if(skinid = 162 || skinid = 217)
Reply
#5

PHP код:
CMD:skin(playerid,params[])
{
       new 
skinidstring[128];
       if(
sscanf(params"d"skinid)) return SendClientMessage(playerid, /skin skinid");
       if(skinid < 1 || skinid > 299) return SendClientMessage(playerid,"
Skin ID must be between 1 and 299!");
       else if(skinid > 162 || skinid < 217) return SendClientMessage(playerid,"
You cannot use this Skin!");
    {
           SetPlayerSkin(playerid, skinid);
           SendClientMessage(playerid,"
Skin changed");
    }
    return 1;

Just do better this brackets because i edited code on this site so...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)