New Way of working with state
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
States are lost when the gamemode is restarted because the file gets unloaded.
okay so my first question answer is no so there is no way for it ? expect variables.
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;
}
Edit i tried this :
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;
}
worked but it only executed the code in "<>"


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
Reply


Messages In This Thread
New Way of working with state - by AroseKhanNiazi - 28.02.2015, 09:17
Re: New Way of working with state - by Vince - 28.02.2015, 09:49
Re: New Way of working with state - by AroseKhanNiazi - 28.02.2015, 09:56
Re: New Way of working with state - by Vince - 28.02.2015, 10:53
Re: New Way of working with state - by AroseKhanNiazi - 28.02.2015, 11:00
Re: New Way of working with state - by AroseKhanNiazi - 03.03.2015, 11:21
AW: Re: New Way of working with state - by Kaliber - 03.03.2015, 12:02
AW: Re: New Way of working with state - by Kaliber - 03.03.2015, 12:21
AW: Re: New Way of working with state - by Kaliber - 03.03.2015, 12:28
Re: AW: Re: New Way of working with state - by AroseKhanNiazi - 03.03.2015, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)