11.07.2012, 10:03
Can't you just make some functions like LoadMap(mapid) and UnloadMap(mapid) that create the pickups/objects. And set a global var that stores the current mapid. Then under your callbacks check which is the current map, and go from there.
Eg,
Eg,
pawn Код:
#define RACE_MAP_LS (1)
#define DM_MAP_LV (2)
new g_iCurrentMapID = 0;
stock LoadMap(mapid)
{
switch(mapid)
{
case RACE_MAP_LS:
{
g_iCurrentMapID = RACE_MAP_LS;
//load objects pickups for this map
}
case DM_MAP_LV:
{
g_iCurrentMapID = DM_MAP_LV;
//load objects pickups for this map
}
}
}
stock UnloadMap(mapid)
{
switch(mapid)
{
case RACE_MAP_LS:
{
g_iCurrentMapID = 0;
//unload objects pickups for this map
}
//...
}
}
public OnPlayerSpawn(playerid)
{
switch(g_iCurrentMapID)
{
case RACE_MAP_LS:
{
//set spawn in this map
}
//...
}
return 1;
}