Owned Cars Disappear on GMX
#1

Well , I Made a Dealership in my Script - It is working fine and everything , but in GMX you lose your owned car , how to stop that ?
Reply
#2

Make a custom restart command. GMX tends to lead to bugs. Here's an example of mine:

pawn Код:
CMD:restart(playerid, params[])
{
    #pragma unused params
    #pragma unused playerid
    new
        uFile[50],
        player_Name[MAX_PLAYER_NAME];

    foreach(Player, i)
    {
        GetPlayerName(i, player_Name, sizeof(player_Name));
        format(uFile, 50, USER_DIRECTORY, player_Name);

        new
            INI:playerFile = INI_Open(uFile);

        INI_WriteInt(playerFile, "AuthLvl", SInfo[i][AuthLvl]);
        INI_WriteInt(playerFile, "VIP", SInfo[i][VIP]);
        INI_WriteInt(playerFile, "Cash", GetPlayerMoney(i));
        INI_WriteInt(playerFile, "Score", GetPlayerScore(i));
        INI_WriteInt(playerFile, "Kills", SInfo[i][Kills]);
        INI_WriteInt(playerFile, "Skin", SInfo[i][CustomSkin]);
        INI_WriteInt(playerFile, "Deaths", SInfo[i][Deaths]);
        INI_WriteInt(playerFile, "CustomCarID", SInfo[i][CustomCarID]);
        INI_WriteInt(playerFile, "CustomCarC1", SInfo[i][CustomCarC1]);
        INI_WriteInt(playerFile, "CustomCarC2", SInfo[i][CustomCarC2]);
        INI_WriteString(playerFile, "CustomCarPlate", SInfo[i][CustomCarPlate]);
       
        printf("<User: System> Saved ID %d", i);

        INI_Close(playerFile);
    }
    GameModeExit();
    return 1;
}
May wish to create an administrator check in there somewhere.
Reply
#3

only that way ? and if i make it like this - i wll have it to save all the other things in the new CMD ?
Reply
#4

Quote:
Originally Posted by Breto
Посмотреть сообщение
only that way ? and if i make it like this - i wll have it to save all the other things in the new CMD ?
There's probably another way, but this is the easiest in my opinion, and yes, you'd have to say it again. Like you did in OnPlayerDisconnect, or your timer to save accounts if you have one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)