OnGameModeExit function
#1

Hi all!
Well, i'm looking for a solution to save player's name after restart, for an clansystem.
Look at my pawno code:

pawn Код:
if(PlayerInfo[playerid][pCMember] != 0 || PlayerInfo[playerid][pCLeader] != 0)
    {
        new pllname[25], newname[25], var[128];
        GetPlayerName(playerid, pllname, 25);
        format(newname, sizeof(newname), "%s", pllname);
        strdel(newname, 0, strlen(PlayerInfo[playerid][pClanTag]));
        SetPlayerName(playerid, newname);
        format(var, sizeof(var), "UPDATE `users` SET `name`='%s' WHERE `name` = '%s'", newname, pllname);
        mysql_query(SQL ,var);
    }
Above pawno code works correct if i restart my server with /rcon gmx (calls OnPlayerDisconnect)


OnGameModeExit function
pawn Код:
new qqerry[256];
foreach(Player, i)
    {
    new nume[25], numenou[25];
    GetPlayerName(i, nume, 25);
    if(PlayerInfo[i][pCMember] != 0 || PlayerInfo[i][pCLeader] != 0)
        {
    format(numenou, 25, "%s", nume);
    strdel(numenou, 0, strlen(PlayerInfo[i][pClanTag]));
    SetPlayerName(i, numenou);
    format(qqerry, sizeof(qqerry), "UPDATE `users` SET `name` = '%s' WHERE `name` = '%s'" , numenou, nume);
    mysql_query(SQL, qqerry);
        }
    }

    mysql_free_result();
If i put this code on OnGameModeExit() function, name is not saved. My question is: Can I do a script when the server is restarted from GameCP to execute callbacks like OnPlayerDisconnect (working on rcon gmx) and OnGameModeExit ?

If i restart my server with /rcon gmx OnPlayerDisconnect works and saves correct new player name (without tag).
Is there any plugin to do that? If my server is restarted from GameCP to execute callbacks like in /rcon gmx?

OR

Is there any lib/plugin to use callback OnPlayerDisconnect/or other Callback when my server is restarted from GamePanel?
Reply


Messages In This Thread
OnGameModeExit function - by JustRed - 18.05.2014, 19:58

Forum Jump:


Users browsing this thread: 1 Guest(s)