Raised This Month: $ Target: $400
 0% 

[SOLVED] Read Multiple Words From One Line?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 11-11-2013 , 17:40   [SOLVED] Read Multiple Words From One Line?
Reply With Quote #1

Atm my file setup is this

Code:
NADE=HE
NADE=SMOKE
NADE=FLASH
with this code
Code:
else if( equali( szWeaponType, "NADE" ) )         {             g_bWeaponItems[ iTeam ][ GRENADE ] = true;             if( equali( szWeaponName, "HE" ) )             {                 g_bGrenades[ iTeam ][ 0 ] = true;             }             else if( equali( szWeaponName, "SMOKE" ) )             {                 g_bGrenades[ iTeam ][ 1 ] = true;             }             else if( equali( szWeaponName, "FLASH" ) )             {                 g_bGrenades[ iTeam ][ 2 ] = true;             }         }
but im trying to get it to read like this

NADES=HE|SMOKE|FLASH

but my code atm only seems to get flash and smoke out of this and not he

Code:
else if( equali( szWeaponType, "NADE" ) )         {             g_bWeaponItems[ iTeam ][ GRENADE ] = true;                         replace_all( szWeaponName, cm( szWeaponName ), "|", " " );                         console_print( 0, "%s", szWeaponName );                         if( contain( szWeaponName, "HE" ) )             {                 g_bGrenades[ iTeam ][ 0 ] = true;             }             if( contain( szWeaponName, "SMOKE" ) )             {                 g_bGrenades[ iTeam ][ 1 ] = true;             }             if( contain( szWeaponName, "FLASH" ) )             {                 g_bGrenades[ iTeam ][ 2 ] = true;             }         }

i know it is proberly something easy im doing wrong just cant see it.

EDIT: Solved

was forgetting the !=-1 in the contain
__________________

Last edited by Blizzard_87; 11-11-2013 at 17:58.
Blizzard_87 is offline
 


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 23:23.


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