08.12.2013, 06:22
These are examples of what I'm trying to do.
Include:
Gamemode:
This example won't work.
Include:
Gamemode:
This example will work.
How do I get properties to work with include and gamemode as one?
Include:
Код:
#define SAF: SAF_ #define MaxString (1028) #define SetString(%0,%1) setproperty(.value = (getproperty(.name =%0) + MaxString), .string =%1) #define GetString(%0) (getproperty(.value = (getproperty(.name =%0) + MaxString), .string = SAF:String), strunpack(SAF:String, SAF:String, MaxString), SAF:String) new SAF:String[MaxString]; stock SetVariables() { SetString("Test", "This is a test."); SetString("Test2", "This is a second test."); new String[100] = "This is a third test."; SetString("Test3", String); return true; }
Код:
public OnGameModeInit() { SetVariables(); print(GetString("Test")); print(GetString("Test2")); print(GetString("Test3")); return true; }
Include:
Код:
#define SAF: SAF_ #define MaxString (1028) #define SetString(%0,%1) setproperty(.value = (getproperty(.name =%0) + MaxString), .string =%1) #define GetString(%0) (getproperty(.value = (getproperty(.name =%0) + MaxString), .string = SAF:String), strunpack(SAF:String, SAF:String, MaxString), SAF:String) new SAF:String[MaxString];
Код:
public OnGameModeInit() { SetString("Test", "This is a test."); SetString("Test2", "This is a second test."); new String[100] = "This is a third test."; SetString("Test3", String); print(GetString("Test")); print(GetString("Test2")); print(GetString("Test3")); return true; }
How do I get properties to work with include and gamemode as one?