GMX Help -
tiernantheman - 08.06.2012
I'm having a problem with my GMX Command when it restarts my player spawns in blueberry and dies. Any help would be great thanks. Here's the GMX Command.
pawn Код:
YCMD:gmx(playerid, params[])
{
if(gPlayerLoggedIn[playerid] == 0) return 1;
if(PlayerInfo[playerid][Admin] >= 5)
{
new string[126];
format(string, sizeof(string), "Warning: %s has set the server to GMX in 10 seconds...", PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
SetTimer("GameModeExitFunc", 10000, false);
}
return 1;
}
Re: GMX Help -
Azazelo - 08.06.2012
Show code of this GameModeExitFunc() function.
Re: GMX Help -
tiernantheman - 08.06.2012
pawn Код:
public GameModeExitFunc()
{
foreach(Player, i)
{
if(gPlayerLoggedIn[i] == 1)
{
SavePlayer(i);
gPlayerLoggedIn[i] = 0;
}
}
GameModeExit();
}
Re: GMX Help -
Azazelo - 08.06.2012
And i presume in you SavePlayer(i); you save a current x,y,z of player position.
Check in you records do you have a this value saved and check you load part do you set this to player.
Re: GMX Help -
JhnzRep - 09.06.2012
Put this on top of your script
Then
pawn Код:
YCMD:gmx(playerid, params[])
{
if(gPlayerLoggedIn[playerid] == 0) return 1;
if(PlayerInfo[playerid][Admin] >= 5)
{
new string[126];
format(string, sizeof(string), "Warning: %s has set the server to GMX in 10 seconds...", PlayerName(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
SetTimer("GameModeExitFunc", 10000, false);
GMX = 1;
}
return 1;
}
Okay, now on player disconnect
And last but not least, put this under OnGameModeInit
Should work! If not check this out
https://sampforum.blast.hk/showthread.php?tid=319439
Re: GMX Help -
ReneG - 09.06.2012
Save the data, kick all the players and THEN restart the server.
Re: GMX Help -
JhnzRep - 09.06.2012
Lol, why would you kick? Just use what I made, and it should work(Works on my server).
Re: GMX Help -
ReneG - 09.06.2012
Quote:
Originally Posted by JhnzRep
Lol, why would you kick? Just use what I made, and it should work(Works on my server).
|
You should kick them so they have to restart their game in order to avoid technical difficulties that come with gmx's. Unless of course you are running a mini-games-like server, then you should kick the players.
Re: GMX Help -
JhnzRep - 09.06.2012
I run a RP server...I guess you could do it your way, but I'm pretty sure my way works fine too.