SA-MP Forums Archive
[Ajuda] Problema com Switch - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Problema com Switch (/showthread.php?tid=292333)



[Ajuda] Problema com Switch - cotonete - 23.10.2011

Код:
	switch(pickupid)
	{
	    case pickups[0]:
	    {
	    	TogglePlayerControllable(playerid, 0);
			ShowMenuForPlayer(MenuBanco[0], playerid);
	    }
case me retorna erro, nгo da para usar assim? ou tem que ser aquela gambiarra com if?
Код:
if(pickupid == pickups[0])
tem como usar com switch, nos cases identificar as variбveis


Re: [Ajuda] Problema com Switch - Macintosh - 23.10.2011

Vocк estб usando isso no OnPlayerUpPickup(Sei lб como й) certo?

Qual o erro que ele lhe retorna.


Re: [Ajuda] Problema com Switch - cotonete - 23.10.2011

Код:
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4725) : error 008: must be a constant expression; assumed zero
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4730) : error 008: must be a constant expression; assumed zero
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4735) : error 008: must be a constant expression; assumed zero
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4740) : error 008: must be a constant expression; assumed zero
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4745) : error 008: must be a constant expression; assumed zero
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4750) : error 008: must be a constant expression; assumed zero
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4755) : error 008: must be a constant expression; assumed zero
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4760) : error 008: must be a constant expression; assumed zero
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4765) : error 008: must be a constant expression; assumed zero
D:\Brбulio's Corporation ©\SA-MP Server\gamemodes\lvdm.pwn(4770) : error 008: must be a constant expression; assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.



Re: [Ajuda] Problema com Switch - Macintosh - 23.10.2011

Poste as linhas...


Re: [Ajuda] Problema com Switch - cotonete - 23.10.2011

ta drogado mano? ahuahau

tire a primeira linha CASE como exemplo..


Re: [Ajuda] Problema com Switch - Macintosh - 23.10.2011

Quote:
Originally Posted by cotonete
Посмотреть сообщение
ta drogado mano? ahuahau

tire a primeira linha CASE como exemplo..


Jб fez isso? \/

Код:
new pickups[5]; // Mude o 5 pra o numero de pickups que vocк colocou + 1