SA-MP Forums Archive
Problem with a command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with a command (/showthread.php?tid=138564)



Problem with a command - Ben147 - 02.04.2010

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?



Re: Problem with a command - aircombat - 02.04.2010

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



Re: Problem with a command - Ben147 - 02.04.2010

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


Re: Problem with a command - aircombat - 02.04.2010

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


Re: Problem with a command - Ben147 - 02.04.2010

Its just a name It's Unvaildskin


Re: Problem with a command - Jakku - 02.04.2010

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;
    }




Re: Problem with a command - Ben147 - 02.04.2010

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


Re: Problem with a command - Ben147 - 02.04.2010

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