function:LoadMap(mapname[])
{
new file[100];
format(file, sizeof(file), MAP_LOCATION, mapname);
if(!fexist(file)) return printf("FATAL ERROR: Failed to load map files %s (File doesnt exist in scriptfiles directory)!", file);
LoadMapSettings(mapname);
print("\n============================================");
print("Currently loading....");
printf("Mapname: %s", MapConfig[MAP_NAME]);
printf("Author: %s", MapConfig[MAP_AUTHOR]);
printf("Version: %s", MapConfig[MAP_VERSION]);
print("============================================");
printf("[MAP: %s] Map settings loaded!", MapConfig[MAP_NAME]);
LoadMapDynamicObjects(MapConfig[MAP_CONFIGURATION_NAME]);
new randomload = random(sizeof(Maplist));
SetTimerEx("LoadMap", MapConfig[MAP_TIME], false, "s", Maplist[randomload]);
return 1;
}
public OnGameModeInit()
{
LoadMap("shipment");
return 1;
}
new file[100];
format(file, sizeof(file), MAP_LOCATION, mapname);
if(!fexist(file)) return printf("FATAL ERROR: Failed to load map files %s (File doesnt exist in scriptfiles directory)!", file)

[16:54:03] Currently loading.... [16:54:03] Mapname: Cargoship [16:54:03] Author: playbox12 [16:54:03] Version: v0.1 [16:54:03] ============================================ [16:54:03] [MAP: Cargoship] Map settings loaded! [16:54:03] [MAP: cargoship] 229 objects loaded! [16:54:06] ============================================ [16:54:06] Currently loading.... [16:54:06] Mapname: Shipment [16:54:06] Author: playbox12 [16:54:06] Version: v0.1 [16:54:06] ============================================ [16:54:06] [MAP: Shipment] Map settings loaded! [16:54:06] [MAP: shipment] 381 objects loaded! [16:54:09] ============================================ [16:54:09] Currently loading.... [16:54:09] Mapname: Shipment [16:54:09] Author: playbox12 [16:54:09] Version: v0.1 [16:54:09] ============================================ [16:54:09] [MAP: Shipment] Map settings loaded! [16:54:09] [MAP: shipment] 381 objects loaded! [16:54:10] [connection] 127.0.0.1:54656 requests connection cookie. [16:54:11] [connection] incoming connection: 127.0.0.1:54656 id: 0 [16:54:11] [join] RedBaron has joined the server (0:127.0.0.1) [16:54:12] FATAL ERROR: Failed to load map files codsamp/Maps/127.0.0.1 (File doesnt exist in scriptfiles directory)! [16:55:28] [part] RedBaron has left the server (0:1)
new file[100];
format(file, sizeof(file), MAP_LOCATION, mapname);
if(!fexist(file)) return printf("FATAL ERROR: Failed to load map files %s (File doesnt exist in scriptfiles directory)!", file)
|
Why this is still called once the map is loaded ?
pawn Код:
|
|
So the problem is that the invalid calling of function (that opens the map files) when connecting to server right?
Can u post the onplayerconnect? |
public OnPlayerConnect(playerid)
{
return 1;
}
function:LoadMap(mapname[])
{
/***Rest of the code**/
new randomload = random(sizeof(Maplist));
SetTimerEx("LoadMap", MapConfig[MAP_TIME], false, "s", Maplist[randomload]);
return 1;
}
new randomload = random(sizeof(Maplist));
SetTimerEx("LoadMap", MapConfig[MAP_TIME], false, "i", randomload);
function:LoadMap(index)
{
new file[100];
format(file, sizeof(file), MAP_LOCATION, Maplist[index]);
if(!fexist(file)) return printf("FATAL ERROR: Failed to load map files %s (File doesnt exist in scriptfiles directory)!", file);
LoadMapSettings(Maplist[index]);
print("\n============================================");
print("Currently loading....");
printf("Mapname: %s", MapConfig[MAP_NAME]);
printf("Author: %s", MapConfig[MAP_AUTHOR]);
printf("Version: %s", MapConfig[MAP_VERSION]);
print("============================================");
printf("[MAP: %s] Map settings loaded!", MapConfig[MAP_NAME]);
LoadMapDynamicObjects(MapConfig[MAP_CONFIGURATION_NAME]);
return 1;
}
public OnGameModeInit()
{
LoadMap(index_of_shipment_goes_here);
return 1;
}