18.05.2013, 16:10
But IT CAN BE gamemode variable. Look - if I'm set variable = 0 at OnGameModeInit or Main, it can be called and it work:
Log:
@edit: I've found another issue - setting PVar before the loop and get it in a loop doesn't work:
pawn Код:
main() // Or OnGameModeInit()
{
new playerid;
new date[3];
new test[128];
gettime(date[0], date[1], date[2]);
sprintf(test, "Hello. Server start at: %d:%d:%d", date[0], date[1], date[2]);
SetPVarString(playerid, "TEST", test);
GetPVarString(playerid, "TEST", test, sizeof(test));
// GetPVarStringEx(y, test, 128, "TEST");
printf(#%s, test);
return false; // or true in OnGameModeinit
}
Код:
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3x, ©2005-2013 SA-MP Team [18:12:35] [18:12:35] Server Plugins [18:12:35] -------------- [18:12:35] Loading plugin: whirlpool [18:12:35] [18:12:35] ================== [18:12:35] [18:12:35] Whirlpool loaded [18:12:35] [18:12:35] ================== [18:12:35] [18:12:35] Loaded. [18:12:35] Loading plugin: YSF [18:12:35] logprintf = 0x00488060 [18:12:35] [18:12:35] =============================== [18:12:35] YSF 0.4.01 loaded [18:12:35] © 2013 Alex "******" Cole [18:12:35] Server version: 0.3x R1-2 [18:12:35] Operating System: Windows [18:12:35] =============================== [18:12:35] m_pServer = 4f23c8 [18:12:35] Loaded. [18:12:35] Loaded 2 plugins. [18:12:35] [18:12:35] Filterscripts [18:12:35] --------------- [18:12:35] Loaded 0 filterscripts. [18:12:35] [18:12:35] [18:12:35] [18:12:35] ======================================= [18:12:35] | | [18:12:35] | YSI version 1.06.0002 | [18:12:35] | By Alex "******" Cole | [18:12:35] | | [18:12:35] ======================================= [18:12:35] [18:12:35] [18:12:35] [18:12:35] Hello. Server start at: 18:12:35
pawn Код:
new pl;
SetPVarInt(pl, "BREAK_ME", 1000);
for(new y = 0; y <= 5000; y++)
{
if(GetPVarInt(pl, "BREAK_ME") == 1000) break; // without == 1000 didn't work too...
printf(#%d, y);
}