28.02.2015, 09:56
(
Последний раз редактировалось AroseKhanNiazi; 28.02.2015 в 10:41.
)
Quote:
States are lost when the gamemode is restarted because the file gets unloaded.
|
I got the idea to do it with variables. and state but alone state won't work ?
and can i do something like this ?
pawn Код:
public OnGameModeInit() <GameMode:LV>
{
//..code here here that LV will use
return 1;
}
public OnGameModeInit() <GameMode:LS>
{
//..code here that LS will use only
return 1;
}
public OnGameModeInit()
{
//..code here that both cities will use.
return 1;
}
pawn Код:
#include <a_samp>
main()
{
state GameMode:LS;
}
public OnGameModeInit() <GameMode:LV>
{
//..code here here that LV will use
print("GM for LV");
return 1;
}
public OnGameModeInit() <GameMode:LS>
{
//..code here that LS will use only
print("GM for LS");
return 1;
}
public OnGameModeInit() <>
{
//..code here that both cities will use.
print("GM for All Cities");
return 1;
}
Edit 2 :
after tries i found this way working
pawn Код:
main()
{
state GameMode:LS;
OnGameModeInit();
print("State Seted to LS");
}
public OnGameModeInit() <GameMode:LV>
{
//..code here here that LV will use
print("GM for LV");
return 1;
}
public OnGameModeInit() <GameMode:LS>
{
//..code here that LS will use only
print("GM for LS");
return 1;
}
public OnGameModeInit() <>
{
//..code here that both cities will use.
print("GM for All Cities");
return 1;
}
but now the problem is i wanted that a callback that should always read and a one that works with city