Raised This Month: $ Target: $400
 0% 

switch with Strings


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-23-2014 , 12:06   switch with Strings
Reply With Quote #1

Hello there,

Just a quick question, is there a better and / or better looking way to do this?
Is there something like switch for integers for strings?
PHP Code:
if(equal(szPos"Start1"))
{
    
g_iStart1Pos[0] = str_to_num(iOrigin[0])
    
g_iStart1Pos[1] = str_to_num(iOrigin[1])
    
g_iStart1Pos[2] = str_to_num(iOrigin[2])
}
else if(
equal(szPos"Start2"))
{
    
g_iStart2Pos[0] = str_to_num(iOrigin[0])
    
g_iStart2Pos[1] = str_to_num(iOrigin[1])
    
g_iStart2Pos[2] = str_to_num(iOrigin[2])
}
else if(
equal(szPos"Finish1"))
{
    
g_iFinish1Pos[0] = str_to_num(iOrigin[0])
    
g_iFinish1Pos[1] = str_to_num(iOrigin[1])
    
g_iFinish1Pos[2] = str_to_num(iOrigin[2])
}
else if(
equal(szPos"Finish2"))
{
    
g_iFinish2Pos[0] = str_to_num(iOrigin[0])
    
g_iFinish2Pos[1] = str_to_num(iOrigin[1])
    
g_iFinish2Pos[2] = str_to_num(iOrigin[2])

__________________
Kia 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 21:09.


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