AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ Enum Loop ] (https://forums.alliedmods.net/showthread.php?t=254954)

Xablau 01-08-2015 18:32

[ Enum Loop ]
 
i have:

g_ePlayerData[id][hats] = "a|b|c|d"

How to:

loop(g_ePlayerData[id][hats])
// Print a
// Print b
// Print c
...

fysiks 01-08-2015 18:45

Re: [ Enum Loop ]
 
This has nothing to do with looping through an enum. You need to parse the string into an array.

Xablau 01-08-2015 18:49

Re: [ Enum Loop ]
 
Quote:

Originally Posted by fysiks (Post 2246635)
This has nothing to do with looping through an enum. You need to parse the string into an array.

I want to give a explodes by "|" and then list item by item.

fysiks 01-08-2015 18:53

Re: [ Enum Loop ]
 
You'll need to loop using strtok(). Use strtok() then check if 'Right' contains the token, if yes, do it again.

I'm quite sure that there exists an explode function somewhere here in the forums. I'd look in the tutorials section first.


All times are GMT -4. The time now is 15:20.

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