case DIALOG_SKIN:
{
if(response) //Continue
{
if(!strval(inputtext)) return ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT, ""COL_WHITE"Skin", ""COL_WHITE"Input the Skin ID below:\n"COL_YELLOW"*Min: 0 || Max: 299*", "Change", "Back");
if(strval(inputtext) > 299 || strval(inputtext) < 0) return ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT, ""COL_WHITE"Skin", ""COL_WHITE"Input the Skin ID below:\n"COL_YELLOW"*Min: 0 || Max: 299*", "Change", "Back");
SetPlayerSkin(playerid, strval(inputtext));
new string[128];
format(string, sizeof(string), ""TAG" Changed your Skin "COL_WHITE"[ID: %d]", strval(inputtext));
SCM(playerid, -1, string);
ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, ""COL_GREEN"Spawn Menu", sstr, "Select", "Back");
}
else ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, ""COL_GREEN"Spawn Menu", sstr, "Select", "Back"); //Back
I recommend using sscanf, because strval returns 0 both when the string is not an integer and also when the value of the string is zero which is causing the trouble in your case
|
case DIALOG_SKIN:
{
if(response) //Continue
{
new skinid;
if(sscanf(inputtext,"d",skinid)) return ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT, ""COL_WHITE"Skin", ""COL_WHITE"Input the Skin ID below:\n"COL_YELLOW"*Min: 0 || Max: 299*", "Change", "Back");
if(skinid > 299 || skinid < 0) return ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT, ""COL_WHITE"Skin", ""COL_WHITE"Input the Skin ID below:\n"COL_YELLOW"*Min: 0 || Max: 299*", "Change", "Back");
SetPlayerSkin(playerid, skinid);
new string[128];
format(string, sizeof(string), ""TAG" Changed your Skin "COL_WHITE"[ID: %d]", skinid);
SCM(playerid, -1, string);
ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, ""COL_GREEN"Spawn Menu", sstr, "Select", "Back");
}
else ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, ""COL_GREEN"Spawn Menu", sstr, "Select", "Back"); //Back