SetSkin problem - 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)
+--- Thread: SetSkin problem (
/showthread.php?tid=314059)
SetSkin problem -
ttloko2 - 28.01.2012
i made this command:
Код:
Код:
dcmd_setskin(playerid, params[])
{
if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[VIP] && gPlayerInfo[playerid][PLAYER_LEVEL] > gCommands[VIP])
{
SendClientMessage(playerid, COLOR_ORANGE, "You must be an VIP to use that command!");
}
else
{
new tmp[256], index, id;
tmp = strtok(params, index);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ORANGE, "[SETSKIN] Usage: /setskin [SKIN ID]");
}
else
{
id = strval(tmp);
if(id >= 300 && id <= -1)
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Invalid ID, Valid IDS: 0-299");
}
else
{
SetPlayerSkin(playerid, id);
}
}
}
return 1;
}
but when you type -1 or 300+ number it doesnt show the message and playercrashes(Invalid skin id).
Re: SetSkin problem -
Hoborific - 28.01.2012
pawn Код:
if( skinid >= 1 && skinid <= 299 )
That's mine, it's opposite of yours but it's actually the right numbers.
try returning too, might help.
Re: SetSkin problem -
Konstantinos - 28.01.2012
Replace
pawn Код:
if(id >= 300 && id <= -1)
To
It's impossible id to be more than 299 and less 0
Re: SetSkin problem -
ttloko2 - 28.01.2012
Worked but explain, whats the diference on && and ||?
Re: SetSkin problem -
Konstantinos - 28.01.2012
Sure