Raised This Month: $ Target: $400
 0% 

switch a value for stock


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Process
Junior Member
Join Date: Jan 2015
Location: Banned
Old 01-03-2015 , 10:45   switch a value for stock
Reply With Quote #1

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 !
Process is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-03-2015 , 10:48   Re: switch a value for stock
Reply With Quote #2

Show us exactly what you did because there is nothing wrong with what you have shown
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Process
Junior Member
Join Date: Jan 2015
Location: Banned
Old 01-03-2015 , 12:59   Re: switch a value for stock
Reply With Quote #3

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"
Process is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-03-2015 , 13:02   Re: switch a value for stock
Reply With Quote #4

https://wiki.alliedmods.net/Pawn_Tut...tch_Statements
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Process
Junior Member
Join Date: Jan 2015
Location: Banned
Old 01-03-2015 , 13:06   Re: switch a value for stock
Reply With Quote #5

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 !
Process is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-03-2015 , 13:08   Re: switch a value for stock
Reply With Quote #6

You obviously don't know since you forgot the { } for each case.

Spoiler
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 01-03-2015 at 13:08.
YamiKaitou is offline
Process
Junior Member
Join Date: Jan 2015
Location: Banned
Old 01-03-2015 , 13:22   Re: switch a value for stock
Reply With Quote #7

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 !
Process is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-03-2015 , 13:27   Re: switch a value for stock
Reply With Quote #8

Your code compiles fine for me, show us what you did.
__________________
HamletEagle is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-03-2015 , 13:27   Re: switch a value for stock
Reply With Quote #9

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
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Process
Junior Member
Join Date: Jan 2015
Location: Banned
Old 01-03-2015 , 13:32   Re: switch a value for stock
Reply With Quote #10

Lool sorry guys , its working i've just add it in a wrong place thanks YamiKaitou . ( Sorry ) | Solved !
Process is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:18.


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