AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   switch a value for stock (https://forums.alliedmods.net/showthread.php?t=254535)

Process 01-03-2015 10:45

switch a value for stock
 
Hey,

i wan't to add a switch of the value like this

PHP Code:

stock type(value){

switch(
value){
case 
0: ...

}


but it didn't work !

YamiKaitou 01-03-2015 10:48

Re: switch a value for stock
 
Show us exactly what you did because there is nothing wrong with what you have shown

Process 01-03-2015 12:59

Re: switch a value for stock
 
when i set

Code:
stock type(value){         switch(value){         case 1 : return 1;     } }

then when i add it in a public

type(1)

they give me this error Error: Only a single statement (or expression) can follow each "case"

YamiKaitou 01-03-2015 13:02

Re: switch a value for stock
 
https://wiki.alliedmods.net/Pawn_Tut...tch_Statements

Process 01-03-2015 13:06

Re: switch a value for stock
 
where is the error i can't found it ! and why did you give me this tutorial i know how to do a switch but can you told me where is my error !

YamiKaitou 01-03-2015 13:08

Re: switch a value for stock
 
You obviously don't know since you forgot the { } for each case.

Spoiler

Process 01-03-2015 13:22

Re: switch a value for stock
 
LOL ! and you too you don't know ! come one man

its one cmd ( return ) It is not necessary for one cmd which is return

you seems that you don't even try it !

Please don't throw a words that you don't know it !

HamletEagle 01-03-2015 13:27

Re: switch a value for stock
 
Your code compiles fine for me, show us what you did.

YamiKaitou 01-03-2015 13:27

Re: switch a value for stock
 
After actually compiling it, I don't get any error with your snippet (with either snippet). So either provide the exact code you used to produce the error or there is nothing wrong

Process 01-03-2015 13:32

Re: switch a value for stock
 
Lool sorry guys , its working i've just add it in a wrong place thanks YamiKaitou . ( Sorry ) | Solved !


All times are GMT -4. The time now is 15:29.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.