Raised This Month: $ Target: $400
 0% 

How can i save and load a string?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-07-2010 , 19:36   Re: How can i save and load a string?
Reply With Quote #1

I recommend reading the String section in the thread posted by fysiks.

Accessing a string within an array of strings and accessing a sub-string can look identical. It all depends on how the variable is defined.

Referencing a string with a supplied index ( Var1[ X ] ) can mean either:
1. You want to reference a full string within an array of strings
-- Works if the var is defined as Var1[ 33 ][ 50 ]
2. You want to access a sub-string within a single string.
-- Works if the var is defined as Var1[ 33 ]

Since you are specifying 'id' as your index I assume you are trying to store data on a per-player basis. To solve your problem, create an array of strings so each player has his own string to store info.

PHP Code:
new Var133 ][ 35 ]

//copy users name to the string array element 'id'
get_user_nameid Var1id ] , charsmaxVar1[] ) );
client_print( [...] , "hello %s" Var1id ] );

//copy "hello there" to the string array element 'id'
copyVar1id ] , charsmaxVar1[] ) , "hello there" ); 
__________________
Bugsy is offline
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 05:15.


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