Thread: Store 3 values
View Single Post
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 10-16-2018 , 20:41   Re: Store 3 values
Reply With Quote #5

Quote:
Originally Posted by Spirit_12 View Post
Can you show me an example with multiple text values?
Not sure if that's what you're asking, nor if that's a good way to go.

PHP Code:
enum Values
{
    
bool:bValue,
    
String:sValue1[32]
    
String:sValue2[32]
    
String:sValue3[32]
}

any g_aValues[MAXPLAYERS 1][Values];

void myfunction(int client)
{
    
g_aValues[client][bValue] = true;

    
strcopy(g_aValues[client][sValue1], 32"Value1");
    
strcopy(g_aValues[client][sValue2], 32"Value2");
    
strcopy(g_aValues[client][sValue3], 32"Value3");

or


PHP Code:
enum Strings
{
    
String:sValue1[32],
    
String:sValue2[32],
    
String:sValue3[32]
}

enum Values
{
    
bool:bValue,
    
aStrings[Strings]
}

any g_aValues[MAXPLAYERS 1][Values];

void myfunction(int client)
{
    
g_aValues[client][bValue] = true;

    
strcopy(g_aValues[client][aStrings][sValue1], 32"Value1");
    
strcopy(g_aValues[client][aStrings][sValue2], 32"Value2");
    
strcopy(g_aValues[client][aStrings][sValue3], 32"Value3");

__________________
coding & free software
shanapu is offline