If tmp > || <.. - 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: If tmp > || <.. (
/showthread.php?tid=263048)
If tmp > || <.. -
Jack_Leslie - 20.06.2011
Hey, I need some help.
Код:
if(strcmp(cmd, "/skin", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x919191FF, "Usage: /skin [SKINID]");
return 1;
}
if(IsAtClothShop(playerid) || PlayerInfo[playerid][pDonateRank] >= 1)
{
new chosenskin = strval(tmp);
SetPlayerSkin(playerid, chosenskin);
PlayerInfo[playerid][pModel] = chosenskin;
return 1;
}
else if (PlayerInfo[playerid][pDonateRank] >= 1)
{
new chosenskin = strval(tmp);
SetPlayerSkin(playerid, chosenskin);
PlayerInfo[playerid][pModel] = chosenskin;
return 1;
}
else {
SendClientMessage(playerid, COLOR_YELLOW, " You are not inside a clothing store!");
}
}
I need to check it before it does "SetPlayerSkin", if the tmp value is under 0 or over 299 then return with an error message to prevent bugging xD
Re: If tmp > || <.. -
Jack_Leslie - 20.06.2011
Help pleaseeee
Re: If tmp > || <.. -
Scenario - 21.06.2011
You can easily add the following:
pawn Код:
if(tmp < 0 || tmp > 299)
return // Error message, skin is invalid.