Posts: 351
Threads: 43
Joined: Jan 2010
Reputation:
0
hey guys, i'm posting because i don't remember what to put in switch's (). What actually i have to put in the () ??
i mean :
switch() //here
{
case 0:
{
thanks for telling me!
Posts: 1,494
Threads: 120
Joined: Dec 2009
Reputation:
0
that depends on what your using.... like if your gonna use it for gTeams then you would doo
switch(gTeam[playerid])
{
//you switch stuff here
}
EDIT: what are you gonna use it for anyways? maybe i can help you more than just an example
Posts: 351
Threads: 43
Joined: Jan 2010
Reputation:
0
i use different custom functions, like example function1[playerid]; and function2[playerid];
can the switch work anyway?
Posts: 6,129
Threads: 36
Joined: Jan 2009
To use separate variables in a switch statement... well, you can't, you need to create another switch statement.
pawn Код:
switch(function1[playerid])
{
case 1: print("yay"); // and so on.
}
switch(function2[playerid])
{
case 1: print("yay"); // and so on.
}
Posts: 351
Threads: 43
Joined: Jan 2010
Reputation:
0
alright thanks :P will be very usefull to know that lol
Posts: 351
Threads: 43
Joined: Jan 2010
Reputation:
0
but does the switch works with a function such as GetPlayerWeapon? like a switch with GetPlayerWeapon(playerid) == 22); and GetPlayerWeapon(playerid) == 23); ??
Posts: 1,494
Threads: 120
Joined: Dec 2009
Reputation:
0
it may, you may have to do that inside the switch() i believe but give it a try^^
Posts: 351
Threads: 43
Joined: Jan 2010
Reputation:
0
but for what i try i need someone to test with me and actually i have nobody to test lol