AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Fetching first character from enum string array (https://forums.alliedmods.net/showthread.php?t=298999)

CouldYouPlease051 06-29-2017 03:54

Fetching first character from enum string array
 
PHP Code:

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

new 
eData[33][Data];

..
szData "Hello"..
eData[id][szData][0returns Hello
eData
[id][szData][1returns ello 


Natsheh 06-29-2017 05:05

Re: Fetching first character from enum string array
 
eData[id][szData][0] ----> %c

CouldYouPlease051 06-29-2017 05:31

Re: Fetching first character from enum string array
 
Are you sure?
PHP Code:

error 028invalid subscript (not an array or too many subscripts): "szData" 


klippy 06-29-2017 07:14

Re: Fetching first character from enum string array
 
Show your code. Depending on what you are doing, accessing the first element will either be the first character or a string.

fysiks 06-29-2017 09:42

Re: Fetching first character from enum string array
 
Quote:

Originally Posted by CouldYouPlease051 (Post 2532399)
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.


All times are GMT -4. The time now is 22:53.

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