Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define SsIntSet(%0,%1); setproperty(0,(format(SsVarName[SsCount++], 24, %0),%0),%1);
- #define SsIntGet(%0) getproperty(0,%0)
- #define MAX_VARS (0x80)
- new SsVarName[MAX_VARS][24], SsCount, bool: Ss_OGMI = false, bool: Ss_OGME = false;
- public OnGameModeInit() {
- Ss_OGMI = funcidx(#Ss_OnGameModeInit) != -1;
- Ss_OGME = funcidx(#Ss_OnGameModeExit) != -1;
- if(fexist("SsVars.temp")) {
- static File: SsFile, SsStr[24], SsVarNome[24], Ss;
- if((SsFile = fopen("SsVars.temp", io_read))) {
- while(fread(SsFile, SsStr)) {
- while(SsStr[Ss] != '=') SsVarNome[Ss] = SsStr[Ss++];
- setproperty(0, SsVarNome, strval(SsStr[++Ss])); Ss = 0;
- }
- fclose(SsFile);
- fremove("SsVars.temp");
- }
- }
- return Ss_OGMI ? CallLocalFunction(#Ss_OnGameModeInit, #) : 1;
- }
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit Ss_OnGameModeInit
- forward Ss_OnGameModeInit();
- public OnGameModeExit() {
- static File: SsFile, SsStr[MAX_VARS], Ss;
- if((SsFile = fopen("SsVars.temp", io_write))) {
- while(Ss != SsCount) {
- format(SsStr, MAX_VARS, "%s=%i\r\n", SsVarName[Ss], getproperty(0, SsVarName[Ss]));
- fwrite(SsFile, (++Ss, SsStr));
- }
- fclose(SsFile);
- }
- return Ss_OGME ? CallLocalFunction(#Ss_OnGameModeExit, #) : 1;
- }
- #if defined _ALS_OnGameModeExit
- #undef OnGameModeExit
- #else
- #define _ALS_OnGameModeExit
- #endif
- #define OnGameModeExit Ss_OnGameModeExit
- forward Ss_OnGameModeExit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement