16.02.2012, 14:44
I'd advise using State Automaton if you intend to create multiple gamemodes within a single file. ****** did a great tutorial on that. Here's a really brief example of what you can do:
pawn Код:
main()
{
state CurrentMap:Map001;
}
entry() <CurrentMap:Map001>
{
// This acts like OnGameModeInit and is called everytime the script switches to this state
SetGameModeText("Map 001");
}
entry() <CurrentMap:Map002>
{
SetGameModeText("Map 002");
}
public OnPlayerSpawn(playerid) <CurrentMap:Map001>
{
// Do stuff for map 1
return 1;
}
public OnPlayerSpawn(playerid) <CurrentMap:Map002>
{
// Do stuff for map 2
return 1;
}