Raised This Month: $53 Target: $400
 13% 

Solved switch question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lexzor
Senior Member
Join Date: Nov 2020
Old 05-13-2021 , 16:50   switch question
Reply With Quote #1

Can i use switch smth like this:

PHP Code:
switch(id)
    {
        case 
1..5set_task(0.1"set_user_data_sql"id DisconnectedTask)
        case 
6..11set_task(0.1"set_user_data_sql"id DisconnectedTask)
        case 
12..17set_task(0.2"set_user_data_sql"id DisconnectedTask)
        case 
18..23set_task(0.2"set_user_data_sql"id DisconnectedTask)
        case 
28..32set_task(0.3"set_user_data_sql"id DisconnectedTask)
    } 

Last edited by lexzor; 05-13-2021 at 18:44.
lexzor is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-13-2021 , 17:00   Re: switch question
Reply With Quote #2

yes, you could just change it to 1..11 and 12..23.

Just try it out, should work.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
lexzor
Senior Member
Join Date: Nov 2020
Old 05-13-2021 , 18:00   Re: switch question
Reply With Quote #3

2 more questions:
1. player index (id) start from 0 or 1 ?
2. Which type of sql data save is better: ip or steamid ?

Last edited by lexzor; 05-13-2021 at 18:02.
lexzor is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2021 , 18:05   Re: switch question
Reply With Quote #4

1 and steam id
__________________
Bugsy is offline
lexzor
Senior Member
Join Date: Nov 2020
Old 05-13-2021 , 18:11   Re: switch question
Reply With Quote #5

Thanks
lexzor is offline
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 09:43.


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