If tmp > || <..
#1

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
Reply
#2

Help pleaseeee
Reply
#3

You can easily add the following:

pawn Код:
if(tmp < 0 || tmp > 299)
    return // Error message, skin is invalid.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)