Raised This Month: $ Target: $400
 0% 

Fetching first character from enum string array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CouldYouPlease051
Junior Member
Join Date: Mar 2017
Old 06-29-2017 , 03:54   Fetching first character from enum string array
Reply With Quote #1

PHP Code:
enum _:Data {
   
szData[10],
   
iData
}

new 
eData[33][Data];

..
szData "Hello"..
eData[id][szData][0returns Hello
eData
[id][szData][1returns ello 
CouldYouPlease051 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-29-2017 , 05:05   Re: Fetching first character from enum string array
Reply With Quote #2

eData[id][szData][0] ----> %c
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-29-2017 at 09:49.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
CouldYouPlease051
Junior Member
Join Date: Mar 2017
Old 06-29-2017 , 05:31   Re: Fetching first character from enum string array
Reply With Quote #3

Are you sure?
PHP Code:
error 028invalid subscript (not an array or too many subscripts): "szData" 
CouldYouPlease051 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 06-29-2017 , 07:14   Re: Fetching first character from enum string array
Reply With Quote #4

Show your code. Depending on what you are doing, accessing the first element will either be the first character or a string.
klippy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-29-2017 , 09:42   Re: Fetching first character from enum string array
Reply With Quote #5

Quote:
Originally Posted by CouldYouPlease051 View Post
eData[id][szData][0] returns Hello
If that works like you say it does then you simply need to print only a character instead of a string using %c.
__________________
fysiks is online now
Reply



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 22:52.


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