PDA

View Full Version : a weird error.


TahaMhr
22/09/2017, 01:56 PM
I was making a "cmds" dialog, which will automatically detect the player level and display the available commands, till level 2, i was going good, from 3rd level, I get an error which i couldn't to resolve.
This is the pic and code till where its going fine:
https://s26.postimg.org/jzd3so5o5/help1.png (https://postimg.org/image/jzd3so5o5/)
dcmd_cmds(playerid, params[])
{
if(AccInfo[playerid][Level] == 0)
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney", "Continue");
return 1;
}
else
if(AccInfo[playerid][Level] == 1)
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin", "Continue");
return 1;
}
else
if(AccInfo[playerid][Level] == 2)
{
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin \nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill", "Continue");
return 1;
}
}

and from here onwards, I start to get errors:
https://s26.postimg.org/qec4pccdx/help2.png (https://postimg.org/image/qec4pccdx/)
dcmd_cmds(playerid, params[])
{
if(AccInfo[playerid][Level] == 0)
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney", "Continue");
return 1;
}
else
if(AccInfo[playerid][Level] == 1)
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin", "Continue");
return 1;
}
else
if(AccInfo[playerid][Level] == 2)
{
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin \nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill", "Continue");
return 1;
}
if(AccInfo[playerid][Level] == 3)
{
ShowPlayerDialog(playerid, 15, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin \nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill \nAdmin Level 3 Commands: \nspawn, announce2, announce, kick, ban, spec, specvehicle, specoff, tempban, write", "Continue");
}
return 1;
}


These are the errors I get:
C:\Users\Jilani\Desktop\Server Files\filterscripts\AdminSys.pwn(4492) : warning 202: number of arguments does not match definition
C:\Users\Jilani\Desktop\Server Files\filterscripts\AdminSys.pwn(4498) : warning 202: number of arguments does not match definition
C:\Users\Jilani\Desktop\Server Files\filterscripts\AdminSys.pwn(4504) : warning 202: number of arguments does not match definition
C:\Users\Jilani\Desktop\Server Files\filterscripts\AdminSys.pwn(4508) : error 075: input line too long (after substitutions)
C:\Users\Jilani\Desktop\Server Files\filterscripts\AdminSys.pwn(4509) : error 037: invalid string (possibly non-terminated string)
C:\Users\Jilani\Desktop\Server Files\filterscripts\AdminSys.pwn(4509) : error 017: undefined symbol "Normal"
C:\Users\Jilani\Desktop\Server Files\filterscripts\AdminSys.pwn(4509) : error 029: invalid expression, assumed zero
C:\Users\Jilani\Desktop\Server Files\filterscripts\AdminSys.pwn(4509) : fatal error 107: too many error messages on one line


Well, warning are fine as I know Im missing button2.

Any help would be appreciated. :)

Kraeror
22/09/2017, 03:30 PM
Here you are brother:
dcmd_cmds(playerid, params[])
{
if(AccInfo[playerid][Level] == 0)
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney", "Continue","");
}
else if(AccInfo[playerid][Level] == 1)
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin", "Continue", "");
}
else if(AccInfo[playerid][Level] == 2)
{
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin \nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill", "Continue", "");
}
else if(AccInfo[playerid][Level] == 3)
{
ShowPlayerDialog(playerid, 15, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin \nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill \nAdmin Level 3 Commands: \nspawn, announce2, announce, kick, ban, spec, specvehicle, specoff, tempban, write", "Continue", "");
}
return 1;
}
+1 REP me if I helped you!

TahaMhr
22/09/2017, 04:30 PM
umm nope brother, still getting those errors, and what did you change in this code? just added the "else" at one place and "" to remove those warning, right?

GaByM
22/09/2017, 04:36 PM
http://wiki.sa-mp.com/wiki/Dialog

ShowPlayerDialog takes 7 parameters, you haven't mentioned the 2nd button of the dialog, if you want to be empty add ""

TahaMhr
22/09/2017, 08:01 PM
http://wiki.sa-mp.com/wiki/Dialog

ShowPlayerDialog takes 7 parameters, you haven't mentioned the 2nd button of the dialog, if you want to be empty add ""
Bro, I know that, and that would just return the warning 202: number of arguments does not match definition, however, i've tried that as well, but it doesn't works. and if it was related to button2, the first 3 wouldn't work either.

10MIN
23/09/2017, 07:53 AM
This will work:

dcmd_cmds(playerid, params[])
{
if(AccInfo[playerid][Level] >= 0)
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney", "Continue","");
}
if(AccInfo[playerid][Level] >= 1)
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin", "Continue", "");
}
if(AccInfo[playerid][Level] >= 2)
{
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin \nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill", "Continue", "");
}
if(AccInfo[playerid][Level] >= 3)
{
ShowPlayerDialog(playerid, 15, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin \nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill \nAdmin Level 3 Commands: \nspawn, announce2, announce, kick, ban, spec, specvehicle, specoff, tempban, write", "Continue", "");
}
return 1;
}

Simple error...

TahaMhr
23/09/2017, 10:30 AM
nope bro, still the same.

Kampott
23/09/2017, 12:26 PM
It says imput line too long, that means your should switch your code to another line,
like this:

ShowPlayerDialog(playerid, 15, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck,
duel, saveskin, useskin, dontuseskin \nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill \nAdmin Level 3 Commands: \nspawn, announce2, announce, kick, ban, spec, specvehicle, specoff, tempban, write", "Continue", "");

GaByM
23/09/2017, 04:52 PM
It says imput line too long, that means your should switch your code to another line,
like this:

ShowPlayerDialog(playerid, 15, DIALOG_STYLE_MSGBOX, "Server Commands", "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney \nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck,
duel, saveskin, useskin, dontuseskin \nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill \nAdmin Level 3 Commands: \nspawn, announce2, announce, kick, ban, spec, specvehicle, specoff, tempban, write", "Continue", "");


You have forgot the "\" after the first line. But this won't solve the problem because lines in PAWN can't have more than 512 characters even though you split them.


ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Notice",
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"Close", "");
//This will produce an error.

So the single way of sending a long message will be to create a variable and then use strcat a few times


new str[500];
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Notice", str, "Close", "");

TahaMhr
27/09/2017, 12:27 PM
You have forgot the "\" after the first line. But this won't solve the problem because lines in PAWN can't have more than 512 characters even though you split them.


ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Notice",
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"Close", "");
//This will produce an error.

So the single way of sending a long message will be to create a variable and then use strcat a few times


new str[500];
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
strcat(str, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaa");
ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Notice", str, "Close", "");

Thanks bro, ik its a late reply, however, how do i use the admin levels for this way? it isnt working properly, i've tried 2-4 ways but couldn't get it working. any help here also?

new str[200];
if(AccInfo[playerid][Level] == 0)
strcat(str, "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney");
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "Server Commands", str, "Close", "");

new str2[500];
if(AccInfo[playerid][Level] == 1)
strcat(str2, "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney");
strcat(str2, "\nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin");
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "Server Commands", str2, "Close", "");

new str3[500];
if(AccInfo[playerid][Level] == 2)
strcat(str3, "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney");
strcat(str3, "\nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin");
strcat(str3, "\nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill");
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_MSGBOX, "Server Commands", str3, "Close", "");

^^^This doesnt works^^^

if(AccInfo[playerid][Level] == 0)
strcat(str, "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney");

if(AccInfo[playerid][Level] == 1)
strcat(str, "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney");
strcat(str, "\nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin");

if(AccInfo[playerid][Level] == 2)
strcat(str, "Normal Player Commands: \n/rules, /cars, /guns, /teles, /dms, /lockcar, /unlockcar, /fix, /report, /topmoney");
strcat(str, "\nAdmin Level 1 Commands: \nsetcolour, settime, setweather, eject, force , burn, asay, highlight, getid, warn, laston, adminarea, hide, unhide, weapslist, morning, reports, miniguns, botcheck, duel, saveskin, useskin, dontuseskin");
strcat(str, "\nAdmin Level 2 Commands: \njailed, frozen, muted, mute, unmute, slap, akill");

ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "Server Commands", str, "Close", "");

^^^This doesnt works either^^^

GaByM
29/09/2017, 02:33 PM
..

You must use brackets if you have more lines. And if you really like, use switch instead, it is faster

So the final code looks like this:

switch(AccInfo[playerid][Level])
{
case 1:
{
// things to do if his level is 1
// like if(AccInfo[playerid][Level] == 1)
}
case 2:
{
//things to do if his lvl is 2
// like if(AccInfo[playerid][Level] == 2)
}
case 3,4,5,6,7,8:
{
//things to do if his lvl is 3, 4, 5, 6, 7 or 8
}
case 9..15:
{
//things to do if his lvl is 9, 10, 11, 12, 13, 14 or 15
}
default:
{
//an else
}
}

TahaMhr
03/10/2017, 07:27 PM
You must use brackets if you have more lines. And if you really like, use switch instead, it is faster

So the final code looks like this:

swithc(AccInfo[playerid][Level])
{
case 1:
{
// things to do if his level is 1
// like if(AccInfo[playerid][Level] == 1)
}
case 2:
{
//things to do if his lvl is 2
// like if(AccInfo[playerid][Level] == 2)
}
case 3,4,5,6,7,8:
{
//things to do if his lvl is 3, 4, 5, 6, 7 or 8
}
case 9..15:
{
//things to do if his lvl is 9, 10, 11, 12, 13, 14 or 15
}
default:
{
//an else
}
}

Thanks alot, worked perfectly. ;)