Raised This Month: $59 Target: $400
 14% 

set case 1 ~ case 100 to simple code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
luverr
Junior Member
Join Date: Nov 2007
Old 06-11-2008 , 18:14   set case 1 ~ case 100 to simple code
Reply With Quote #1

HI,
First of all i had searched "simple code" for 1 hours.

but i can't find it

so i write this Thread

Quote:
new random = random_num(0,100)
switch(random)
{
case 1 : set_pev(id,pev_viewmodel,"models/v_knife.mdl")
.....
case 100 : set_pev(id,pev_viewmodel,"models/custom/v_custom.mdl")
}
Quote is example

if number(case number) is 1 2 3 ~ 97 98 100,
Should i write such like QUOTE?

if the answer is no, Would you tell me the Way?

-----------------------------------------------------------------------

i'm non english culture
i'm Asian

Last edited by luverr; 06-11-2008 at 18:18.
luverr is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-11-2008 , 23:41   Re: set case 1 ~ case 100 to simple code
Reply With Quote #2

Code:
case 1 .. 100 :
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 06-12-2008 , 09:32   Re: set case 1 ~ case 100 to simple code
Reply With Quote #3

http://wiki.amxmodx.org/Pawn_Tutorial#Switch_Statements
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Reply


Thread Tools
Display Modes

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 21:25.


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