Problem with a command
#1

i maded simple command

Код:
forward IsUnValidSkin(skinid);
Код:
public IsUnValidSkin(skinid)
{
if(skinid == 3 || skinid == 4 || skinid == 5 || skinid == 6 || skinid == 8 || skinid == 10 || skinid == 42 || skinid == 65 || skinid == 74 || skinid == 86 || skinid == 92 || skinid == 99 || skinid == 119 || skinid == 149 || skinid == 178 || skinid == 208 || skinid == 264 || skinid == 273 || skinid == 284|| skinid == 285|| skinid == 289)
  {
	return 1;
  }
return 0;
}
Код:
	new id = strval(tmp);
	if(IsUnValidSkin(id))
	{
	SendClientMessage(playerid, COLOR_GRAD2,"You cannot buy this clothes");
	return 1;
	}
but when im using the command and write one id from isvaildskin it's not going to the if

it's change me the skin...

where is the problem in the script?
Reply
#2

change that :
Код:
if(IsValidSkin(id))
to :
Код:
if(!IsValidSkin(id))
Reply
#3

no... the message will send only if the player choosed one id from IsVaildSkin
Reply
#4

ur code mean if the player choose a valid skin it send the msg , ! mean if not if(!ValidSkin)
Reply
#5

Its just a name It's Unvaildskin
Reply
#6

If you use this:

pawn Код:
if(IsValidSkin(id))
    {
    SendClientMessage(playerid, COLOR_GRAD2,"You cannot buy this clothes");
    return 1;
    }
It will send you that client message if the skin is valid. Use this, and it will work:

pawn Код:
if(!IsValidSkin(id))
    {
    SendClientMessage(playerid, COLOR_GRAD2,"You cannot buy this clothes");
    return 1;
    }

Reply
#7

You didn't understanded me watch again the script i changed it
Reply
#8

Solved, i found where is the problem , thanks you guys anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)