i don't remember...
#1

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

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

i use different custom functions, like example function1[playerid]; and function2[playerid];

can the switch work anyway?
Reply
#4

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.
}
Reply
#5

alright thanks :P will be very usefull to know that lol
Reply
#6

but does the switch works with a function such as GetPlayerWeapon? like a switch with GetPlayerWeapon(playerid) == 22); and GetPlayerWeapon(playerid) == 23); ??
Reply
#7

it may, you may have to do that inside the switch() i believe but give it a try^^
Reply
#8

but for what i try i need someone to test with me and actually i have nobody to test lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)