This code crashwing pawno
#1

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;
}
Reply
#2

pawn Код:
public GMChange();
When did we use a ; in front of public callbacks.
Reply
#3

.......................oh.
Reply
#4

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?
Reply
#5

Код:
format(modestring,sizeof(modestring),"mapname %s",ModeNames[randmode]);
Reply
#6

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","");
Reply
#7

Nope, still the same problem. The gamemodes are compiled well and i have all the .amx files.
Reply
#8

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)