06.06.2017, 22:40
Hey guys. I'm making a clothes shop where players can buy new skins.
For some reason it's not working: always that dialog appears which is meant to tell the player that he/she can only buy a new skin according to his/her gender and origin, even if the player writes an invalid value (more/less than 0-311).
I've made some quotes translating the text to english.
The code:
For some reason it's not working: always that dialog appears which is meant to tell the player that he/she can only buy a new skin according to his/her gender and origin, even if the player writes an invalid value (more/less than 0-311).
I've made some quotes translating the text to english.
The code:
PHP код:
case dialog_ruhabolt: // dialog_clothesshop
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
if(response)
{
if(strval(inputtext) < 0 || strval(inputtext) > 311)
{
ShowPlayerDialog(playerid, dialog_ruhabolt, DIALOG_STYLE_INPUT, "{FFFFFF}Binco ruhabolt", "{FFFFFF}Rossz ruha ID.\nPrуbбlj egy mбsikat:","Megvesz","Mйgsem");
// in eng.: "invalid skin ID, try another"
}
// Skins forbidden for everyone
if(strval(inputtext) == 70 || 74 || 149 || 265 || 266 || 267 || 274 || 275 || 276 || 277 || 278 || 279 || 280 || 281 || 282 || 283 || 284 || 285 || 286 ||
287 || 288 || 300 || 301 || 302 || 303 || 304 || 305 || 306 || 307 || 308 || 309 || 310 || 311)
{
ShowPlayerDialog(playerid, dialog_ruhabolt, DIALOG_STYLE_INPUT, "{FFFFFF}Binco ruhabolt", "{FFFFFF}Ezt a ruhбt nem vбsбrolhatod meg.\nPrуbбlj egy mбsikat:","Megvesz","Mйgsem");
// in eng.: "you cannot purchase these clothes"
}
if(PlayerInfo[playerid][pNem] == 0) // if player is MALE
{
// forbidden: female skins
if(strval(inputtext) == 9 || 10 || 11 || 12 || 13 || 31 || 39 || 40 || 41 || 53 || 54 || 55 || 56 || 63 || 64 || 65 || 69 || 75 || 76 || 77 ||
85 || 86 || 87 || 88 || 89 || 90 || 91 || 92 || 93 || 129 || 130 || 131 || 138 || 139 || 140 || 141 || 145 || 148 || 150 || 151 || 152 ||
157 || 169 || 172 || 178 || 190 || 191 || 192 || 193 || 194 || 195 || 196 || 197 || 198 || 199 || 201 || 205 || 207 || 211 || 214 || 215 ||
216 || 218 || 219 || 224 || 225 || 226 || 231 || 232 || 233 || 237 || 238 || 243 || 244 || 245 || 246 || 251 || 256 || 257 || 263 || 298 ||
306 || 307 || 308 || 309)
{
ShowPlayerDialog(playerid, dialog_ruhabolt, DIALOG_STYLE_INPUT, "{FFFFFF}Binco ruhabolt", "{FFFFFF}Csak a sajбt nemednek йs szбrmazбsodnak megfelelő ruhбzatot vбsбrolhatsz!","Megvesz","Mйgse");
// in eng.: "you can only purchase clothes suitable for your gender and origin"
}
if(PlayerInfo[playerid][pSzarmazas] == 0 || 2 || 4 || 5 || 6 || 7 || 8 || 9 || 10) // IF: american, latin-am., hun, ita, rus, esp, ukr, jap, chn
{
// not suitable skins:
if(strval(inputtext) == 0 || 4 || 5 || 6 || 7 || 14 || 15 || 16 || 17 || 18 || 19 || 20 || 21 || 22 || 24 || 25 || 28 || 35 || 36 ||
66 || 67 || 79 || 80 || 83 || 84 || 86 || 102 || 103 || 104 || 105 || 106 || 107 || 134 || 136 || 142 || 143 || 144 || 163 || 168 ||
176 || 180 || 182 || 183 || 220 || 221 || 222 || 253 || 260 || 293 || 296 || 297)
{
ShowPlayerDialog(playerid, dialog_ruhabolt, DIALOG_STYLE_INPUT, "{FFFFFF}Binco ruhabolt", "{FFFFFF}Csak a sajбt nemednek йs szбrmazбsodnak megfelelő ruhбzatot vбsбrolhatsz!", "Megvesz","Mйgse");
}
else
{
new money = GetPlayerMoney(playerid);
if(money < 200)
{
SendClientMessage(playerid, COLOR_WHITE, "Nincs elйg pйnzed ъj ruhбt vбsбrolni.");
}
else // has enough money + wrote a suitable skin:
{
GivePlayerMoney(playerid, -200);
SetPlayerSkin(playerid, strval(inputtext));
SendClientMessage(playerid, COLOR_WHITE, "Ъj ruhбt vettйl magadnak.");
}
}
}
if(PlayerInfo[playerid][pSzarmazas] == 1 || 3) // IF: afro-am, arab
{
// not suitable skins:
if(strval(inputtext) != 0 || 4 || 5 || 6 || 7 || 14 || 15 || 16 || 17 || 18 || 19 || 20 || 21 || 22 || 24 || 25 || 28 || 30 || 35 || 36 ||
66 || 67 || 79 || 80 || 83 || 84 || 86 || 102 || 103 || 104 || 105 || 106 || 107 || 134 || 136 || 142 || 143 || 144 || 163 || 168 ||
176 || 180 || 182 || 183 || 220 || 221 || 222 || 253 || 260 || 293 || 296 || 297)
{
ShowPlayerDialog(playerid, dialog_ruhabolt, DIALOG_STYLE_INPUT, "{FFFFFF}Binco ruhabolt", "{FFFFFF}Csak a sajбt nemednek йs szбrmazбsodnak megfelelő ruhбzatot vбsбrolhatsz!", "Megvesz","Mйgse");
}
else // has enough money + wrote a suitable skin:
{
new money = GetPlayerMoney(playerid);
if(money < 200)
{
SendClientMessage(playerid, COLOR_WHITE, "Nincs elйg pйnzed ъj ruhбt vбsбrolni.");
}
else
{
GivePlayerMoney(playerid, -200);
SetPlayerSkin(playerid, strval(inputtext));
SendClientMessage(playerid, COLOR_WHITE, "Ъj ruhбt vettйl magadnak.");
}
}
}
}
if(PlayerInfo[playerid][pNem] == 1) // if FEMALE
{
// forbidden: male skins
if(strval(inputtext) == 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 14 || 15 || 16 || 17 || 18 || 19 || 20 || 21 || 22 || 23 || 24 || 25 ||
26 || 27 || 28 || 29 || 30 || 32 || 33 || 34 || 35 || 36 || 37 || 38 || 42 || 43 || 44 || 45 || 46 || 47 || 48 || 49 || 50 || 51 || 52 ||
57 || 58 || 59 || 60 || 61 || 62 || 66 || 67 || 68 || 71 || 72 || 73 || 78 || 79 || 80 || 81 || 82 || 83 || 84 || 86 || 94 || 95 || 96 ||
97 || 98 || 99 || 100 || 101 || 102 || 103 || 104 || 105 || 106 || 107 || 108 || 109 || 110 || 111 || 112 || 113 || 114 || 115 || 116 ||
117 || 118 || 119 || 120 || 121 || 122 || 123 || 124 || 125 || 126 || 127 || 128 || 132 || 133 || 134 || 135 || 136 || 137 || 142 || 143 ||
144 || 146 || 147 || 153 || 154 || 155 || 156 || 158 || 159 || 160 || 161 || 162 || 163 || 164 || 165 || 166 || 167 || 168 || 170 || 171 ||
173 || 174 || 175 || 176 || 177 || 179 || 180 || 181 || 182 || 183 || 184 || 185 || 186 || 187 || 188 || 189 || 200 || 202 || 203 || 204 ||
206 || 208 || 209 || 210 || 212 || 213 || 220 || 221 || 222 || 223 || 227 || 228 || 229 || 230 || 234 || 235 || 236 || 239 || 240 || 241 ||
242 || 247 || 248 || 249 || 250 || 252 || 253 || 254 || 255 || 258 || 259 || 260 || 261 || 262 || 264 || 268 || 269 || 270 || 271 || 272 ||
273 || 290 || 291 || 292 || 293 || 294 || 295 || 296 || 297 || 299)
{
ShowPlayerDialog(playerid, dialog_ruhabolt, DIALOG_STYLE_INPUT, "{FFFFFF}Binco ruhabolt", "{FFFFFF}Csak a sajбt nemednek йs szбrmazбsodnak megfelelő ruhбzatot vбsбrolhatsz!","Megvesz","Mйgse");
}
if(PlayerInfo[playerid][pSzarmazas] == 0 || 2 || 4 || 5 || 6 || 7 || 8 || 9 || 10) // IF: american, latin-am., hun, ita, rus, esp, ukr, jap, chn
{
// not suitable skins:
if(strval(inputtext) == 9 || 10 || 11 || 12 || 13 || 63 || 65 || 69 || 76 || 139 || 148 || 195 || 207 || 215 || 219 || 238 || 243 ||
244 || 245 || 256)
{
ShowPlayerDialog(playerid, dialog_ruhabolt, DIALOG_STYLE_INPUT, "{FFFFFF}Binco ruhabolt", "{FFFFFF}Csak a sajбt nemednek йs szбrmazбsodnak megfelelő ruhбzatot vбsбrolhatsz!", "Megvesz","Mйgse");
}
else
{
new money = GetPlayerMoney(playerid);
if(money < 200)
{
SendClientMessage(playerid, COLOR_WHITE, "Nincs elйg pйnzed ъj ruhбt vбsбrolni.");
}
else // has enough money + suitable skin:
{
GivePlayerMoney(playerid, -200);
SetPlayerSkin(playerid, strval(inputtext));
SendClientMessage(playerid, COLOR_WHITE, "Ъj ruhбt vettйl magadnak.");
}
}
}
if(PlayerInfo[playerid][pSzarmazas] == 1 || 3) // IF: afro-am., arab
{
// not suitable skins:
if(strval(inputtext) != 9 || 10 || 11 || 12 || 13 || 63 || 65 || 69 || 76 || 139 || 148 || 195 || 207 || 215 || 219 || 238 || 243 ||
244 || 245 || 256)
{
ShowPlayerDialog(playerid, dialog_ruhabolt, DIALOG_STYLE_INPUT, "{FFFFFF}Binco ruhabolt", "{FFFFFF}Csak a sajбt nemednek йs szбrmazбsodnak megfelelő ruhбzatot vбsбrolhatsz!", "Megvesz","Mйgse");
}
else // has enough money + suitable skin:
{
new money = GetPlayerMoney(playerid);
if(money < 200)
{
SendClientMessage(playerid, COLOR_WHITE, "Nincs elйg pйnzed ъj ruhбt vбsбrolni.");
}
else
{
GivePlayerMoney(playerid, -200);
SetPlayerSkin(playerid, strval(inputtext));
SendClientMessage(playerid, COLOR_WHITE, "Ъj ruhбt vettйl magadnak.");
}
}
}
}
}
}