Raised This Month: $ Target: $400
 0% 

Array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MacL
Member
Join Date: May 2021
Old 05-26-2021 , 08:48   Re: Array
Reply With Quote #5

Quote:
Originally Posted by Celena Luna View Post
Create a global variable and save my_vib then use it on somearray when needed
PHP Code:
new g_vib

...

g_vib my_vib //Save your vib
switch(my_vib)
{
    case 
1:
    { 
        
somearray[0]
    }
    case 
2:
    {
        
somearray[1]
    }
    case 
3:
    {
        
somearray[2]
    }


...

client_print(idprint_chat"hi %s"somearray[g_vib]); 
Or there is dumber way is using for loop then comparing the string inside.
Once found the correct one then break the loop.
Thanks. i made a int and gave it a number in every case. then i used it inside client_print.
MacL is offline
 



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 20:00.


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