This code crashwing pawno -
Face9000 - 22.09.2015
Alright, i setup a fast code for random changing gamemodes, but when compiling this makes crash Pawno:
Код:
new ModeNames[][] =
{
{"GM1"},
{"GM2"},
{"GM3"},
{"GM4"}
};
public GMChange();
{
new modestring[50];
new randmode = random(sizeof(ModeNames));
format(modestring,sizeof(modestring),"The Next mode will be %s!",ModeNames[randmode]);
SendClientMessageToAll(0x32CD32FF,modestring);
format(modestring,sizeof(modestring),"changemode %s",ModeNames[randmode]);
SendRconCommand(modestring)
return 1;
}
Re: This code crashwing pawno -
Gammix - 22.09.2015
When did we use a
; in front of public callbacks.
Re: This code crashwing pawno -
Face9000 - 22.09.2015
.......................oh.
Re: This code crashwing pawno -
Face9000 - 22.09.2015
Ok the code seems working at 50%. I explain:
I have a mini missions server which the missions are in the gamemode folder and the main core of the server is in a filterscript. I placed that code in the main core, and this code:
Код:
CallRemoteFunction("GMChange","d");
To all the 4 missions: GM1, 2, 3 and 4.
But, when calling GMChange, the server is stuck at "Server is restarting" and doesn't load next random GM...What's wrong?
Re: This code crashwing pawno -
Affan - 22.09.2015
Код:
format(modestring,sizeof(modestring),"mapname %s",ModeNames[randmode]);
Re: This code crashwing pawno -
Gammix - 22.09.2015
1. Make sure the Gamemode (GM1, GM2..) are compiled well and have
.amx.
2. If this is the code alone:
pawn Код:
CallRemoteFunction("GMChange","d");
This is the correct method:
pawn Код:
CallRemoteFunction("GMChange","");
Re: This code crashwing pawno -
Face9000 - 22.09.2015
Nope, still the same problem. The gamemodes are compiled well and i have all the .amx files.
Re: This code crashwing pawno -
Face9000 - 22.09.2015
If someone wanna help me, this is the GameModeExitFunc used in a gamemode:
Код:
public GameModeExitFunc(playerid)
{
CallRemoteFunction("GMChange","");
GameTextForAll("~y~Loading next mission ~n~ ~w~Please Wait....",5000,5);
return 1;
}
What's wrong? Why it stucks on server restart?