GMX command issue
#1

Hello everyone,

I'm trying to solve the GMX issue but I just cant. I need your help.
There is no Errors or something. Only issue I'll show you the code and bring you some small desc.

The Public:

pawn Код:
public OnGameModeExit()
{
    foreach (Player,i)
    {
        OnPlayerDataSave(i);
        DeletePVar(i, "PlayerLogged");
    }
    SaveBizz();
    SaveProperty();
    SaveCars();
    SaveFactions();
    SaveInts();
    SaveTags();
    SaveNormalCars();
    SaveCars2();
    printf("Gamemode has been restarted successfully.");
    return 1;
}




The Command:


pawn Код:
COMMAND:gmx(playerid, params[])
{
    if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
    if(!AdminUser(playerid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You need to create a admin user, /admincreate.");
    if(GetPVarInt(playerid, "AdminLogged") == 0) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You need to login into your admin account, /adminlogin.");
    if(GetPVarInt(playerid, "Admin") >= 10)
    GameModeExit();
    else SendClientMessage(playerid, COLOR_LIGHTRED, "You do not have access to this command !");
    return 1;
}
When I'm typing this command the server is being restarted and my account stay like I logged in before and not like I left him after the reset. I just dont know what is the issue here in the script I just Its aint working.

Thanks for everyones support.
Reply
#2

if u need technical help in these
Quote:

Add me On skype: ahbasem

Photo:redspeed servers
Reply
#3

Anyone else?
Reply
#4

Someone?
Reply
#5

Can you show us that OnPlayerDataSave function.


Ignore Marcoes. He's a spammer that posts his skype name on every single post.
Reply
#6

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Can you show us that OnPlayerDataSave function.


Ignore Marcoes. He's a spammer that posts his skype name on every single post.
Thanks for the help first

Here is the function:

pawn Код:
public OnPlayerDataSave(playerid)
{
    if(IsPlayerConnected(playerid) && GetPVarInt(playerid, "PlayerLogged") == 1)
    {
        new string[128];
        format(string, sizeof(string), "users/%s.ini", PlayerName(playerid));
        if(DOF2_FileExists(string))
        {
            new Float:health,Float:armour,Float:x, Float:y, Float:z,world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid),wep[13], ammo[13], Float:angle;
            GetPlayerPos(playerid,x,y,z); GetPlayerHealth(playerid,health); GetPlayerArmour(playerid,armour);
            if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
            {
                SetPVarFloat(playerid, "PosX", x); SetPVarFloat(playerid, "PosY", y); SetPVarFloat(playerid, "PosZ", z);
                SetPVarFloat(playerid, "Health", health); SetPVarFloat(playerid, "Armour", armour);
                SetPVarInt(playerid, "Int", interior); SetPVarInt(playerid, "World", world);
            }
            GetPlayerFacingAngle(playerid,angle);
            SetPVarFloat(playerid, "Angle", angle);
            for(new slot = 0; slot < 13; slot++)
            {
                GetPlayerWeaponData(playerid, slot, wep[slot], ammo[slot]);
                if(wep[slot] != 0 && ammo[slot] != 0 && PlayerWeapons[playerid][wep[slot]] == 1)
                {
                    PlayerInfo[playerid][pWeapon][slot]=wep[slot];
                    PlayerInfo[playerid][pAmmo][slot]=ammo[slot];
                }
                else
                {
                    PlayerInfo[playerid][pWeapon][slot]=0;
                    PlayerInfo[playerid][pAmmo][slot]=0;
                }
            }
            // Ints //
            DOF2_SetInt(string, "Cash", GetPVarInt(playerid, "PlayerCash"));
            DOF2_SetInt(string, "Model", GetPVarInt(playerid, "Model"));
            DOF2_SetInt(string, "Crash", GetPVarInt(playerid, "Crash"));
            DOF2_SetInt(string, "Age", GetPVarInt(playerid, "Age"));
            DOF2_SetInt(string, "Int", GetPVarInt(playerid, "Int"));
            DOF2_SetInt(string, "World", GetPVarInt(playerid, "World"));
            DOF2_SetInt(string, "PayDay", GetPVarInt(playerid, "PayDay"));
            DOF2_SetInt(string, "PayCheck", GetPVarInt(playerid, "PayCheck"));
            DOF2_SetInt(string, "Bank", GetPVarInt(playerid, "Bank"));
            DOF2_SetInt(string, "ConnectTime", GetPVarInt(playerid, "ConnectTime"));
            DOF2_SetInt(string, "Member", GetPVarInt(playerid, "Member"));
            DOF2_SetInt(string, "Rank", GetPVarInt(playerid, "Rank"));
            DOF2_SetInt(string, "Weed", GetPVarInt(playerid, "Weed"));
            DOF2_SetInt(string, "Crack", GetPVarInt(playerid, "Crack"));
            DOF2_SetInt(string, "DeveloperRank", PlayerInfo[playerid][pIsDev]);
            DOF2_SetInt(string, "Cocaine", GetPVarInt(playerid, "Cocaine"));
            DOF2_SetInt(string, "HouseKey", GetPVarInt(playerid, "HouseKey"));
            DOF2_SetInt(string, "BizzKey", GetPVarInt(playerid, "BizzKey"));
            DOF2_SetInt(string, "CarKey1", GetPVarInt(playerid, "CarKey1"));
            DOF2_SetInt(string, "CarKey2", GetPVarInt(playerid, "CarKey2"));
            DOF2_SetInt(string, "CarKey3", GetPVarInt(playerid, "CarKey3"));
            DOF2_SetInt(string, "Admin", GetPVarInt(playerid, "Admin"));
            DOF2_SetInt(string, "Helper", GetPVarInt(playerid, "Helper"));
            DOF2_SetInt(string, "Banned", GetPVarInt(playerid, "Banned"));
            DOF2_SetInt(string, "RegTeam", GetPVarInt(playerid, "RegTeam"));
            DOF2_SetInt(string, "Approve", GetPVarInt(playerid, "Approve"));
            DOF2_SetInt(string, "DrugTime", GetPVarInt(playerid, "DrugTime"));
            DOF2_SetInt(string, "HouseEnter", GetPVarInt(playerid, "HouseEnter"));
            DOF2_SetInt(string, "BizzEnter", GetPVarInt(playerid, "BizzEnter"));
            DOF2_SetInt(string, "GunLic", GetPVarInt(playerid, "GunLic"));
            DOF2_SetInt(string, "DriveLic", GetPVarInt(playerid, "DriveLic"));
            DOF2_SetInt(string, "PhoneNum", GetPVarInt(playerid, "PhoneNum"));
            DOF2_SetInt(string, "Job", GetPVarInt(playerid, "Job"));
            DOF2_SetInt(string, "Jailed", GetPVarInt(playerid, "Jailed"));
            DOF2_SetInt(string, "JailTime", GetPVarInt(playerid, "JailTime"));
            DOF2_SetInt(string, "Weapon0", PlayerInfo[playerid][pWeapon][0]);
            DOF2_SetInt(string, "Weapon1", PlayerInfo[playerid][pWeapon][1]);
            DOF2_SetInt(string, "Weapon2", PlayerInfo[playerid][pWeapon][2]);
            DOF2_SetInt(string, "Weapon3", PlayerInfo[playerid][pWeapon][3]);
            DOF2_SetInt(string, "Weapon4", PlayerInfo[playerid][pWeapon][4]);
            DOF2_SetInt(string, "Weapon5", PlayerInfo[playerid][pWeapon][5]);
            DOF2_SetInt(string, "Weapon6", PlayerInfo[playerid][pWeapon][6]);
            DOF2_SetInt(string, "Weapon7", PlayerInfo[playerid][pWeapon][7]);
            DOF2_SetInt(string, "Weapon8", PlayerInfo[playerid][pWeapon][8]);
            DOF2_SetInt(string, "Weapon9", PlayerInfo[playerid][pWeapon][9]);
            DOF2_SetInt(string, "Weapon10", PlayerInfo[playerid][pWeapon][10]);
            DOF2_SetInt(string, "Weapon11", PlayerInfo[playerid][pWeapon][11]);
            DOF2_SetInt(string, "Weapon12", PlayerInfo[playerid][pWeapon][12]);
            DOF2_SetInt(string, "Ammo0", PlayerInfo[playerid][pAmmo][0]);
            DOF2_SetInt(string, "Ammo1", PlayerInfo[playerid][pAmmo][1]);
            DOF2_SetInt(string, "Ammo2", PlayerInfo[playerid][pAmmo][2]);
            DOF2_SetInt(string, "Ammo3", PlayerInfo[playerid][pAmmo][3]);
            DOF2_SetInt(string, "Ammo4", PlayerInfo[playerid][pAmmo][4]);
            DOF2_SetInt(string, "Ammo5", PlayerInfo[playerid][pAmmo][5]);
            DOF2_SetInt(string, "Ammo6", PlayerInfo[playerid][pAmmo][6]);
            DOF2_SetInt(string, "Ammo7", PlayerInfo[playerid][pAmmo][7]);
            DOF2_SetInt(string, "Ammo8", PlayerInfo[playerid][pAmmo][8]);
            DOF2_SetInt(string, "Ammo9", PlayerInfo[playerid][pAmmo][9]);
            DOF2_SetInt(string, "Ammo10", PlayerInfo[playerid][pAmmo][10]);
            DOF2_SetInt(string, "Ammo11", PlayerInfo[playerid][pAmmo][11]);
            DOF2_SetInt(string, "Ammo12", PlayerInfo[playerid][pAmmo][12]);
            DOF2_SetInt(string, "WantedLevel", GetPVarInt(playerid, "WantedLevel"));
            DOF2_SetInt(string, "DonateRank", GetPVarInt(playerid, "DonateRank"));
            DOF2_SetInt(string, "Mask", GetPVarInt(playerid, "Mask"));
            DOF2_SetInt(string, "MaskID", GetPVarInt(playerid, "MaskID"));
            DOF2_SetInt(string, "Cellphone", GetPVarInt(playerid, "Cellphone"));
            DOF2_SetInt(string, "Crimes", GetPVarInt(playerid, "Crimes"));
            DOF2_SetInt(string, "Arrest", GetPVarInt(playerid, "Arrest"));
            DOF2_SetInt(string, "Changes", GetPVarInt(playerid, "Changes"));
            DOF2_SetInt(string, "Sex", GetPVarInt(playerid, "Sex"));
            DOF2_SetInt(string, "Tutorial", GetPVarInt(playerid, "Tut"));
            DOF2_SetInt(string, "CarTicket", GetPVarInt(playerid, "CarTicket"));
            DOF2_SetInt(string, "Fightstyle", GetPVarInt(playerid, "FightStyle"));
            DOF2_SetInt(string, "WalkieTalkie", GetPVarInt(playerid, "WalkieTalkie"));
            DOF2_SetInt(string, "WalkieFreq", GetPVarInt(playerid, "WalkieFreq"));
            DOF2_SetInt(string, "Ticket1", PlayerInfo[playerid][pTicket][0]);
            DOF2_SetInt(string, "Ticket2", PlayerInfo[playerid][pTicket][1]);
            DOF2_SetInt(string, "Ticket3", PlayerInfo[playerid][pTicket][2]);
            DOF2_SetInt(string, "Ticket4", PlayerInfo[playerid][pTicket][3]);
            DOF2_SetInt(string, "Ticket5", PlayerInfo[playerid][pTicket][4]);
            DOF2_SetInt(string, "Bans", GetPVarInt(playerid, "Bans"));
            DOF2_SetInt(string, "Kicks", GetPVarInt(playerid, "Kicks"));
            DOF2_SetInt(string, "Jails", GetPVarInt(playerid, "Jails"));
            DOF2_SetInt(string, "CheckEarn", GetPVarInt(playerid, "CheckEarn"));
            DOF2_SetInt(string, "CarTicket", GetPVarInt(playerid, "CarTicket"));
            DOF2_SetInt(string, "Changes", GetPVarInt(playerid, "Changes"));
            DOF2_SetInt(string, "Cigs", GetPVarInt(playerid, "Cigs"));
            DOF2_SetInt(string, "Lighter", GetPVarInt(playerid, "Lighter"));
            DOF2_SetInt(string, "Dead", GetPVarInt(playerid, "Dead"));
            DOF2_SetInt(string, "WalkStyle", GetPVarInt(playerid, "WalkStyle"));
            DOF2_SetInt(string, "Chatstyle", GetPVarInt(playerid, "ChatStyle"));
            DOF2_SetInt(string, "Bag", GetPVarInt(playerid, "Bag"));
            DOF2_SetInt(string, "CellID", GetPVarInt(playerid, "CellID"));
            DOF2_SetInt(string, "GasCan", GetPVarInt(playerid, "GasCan"));
            DOF2_SetInt(string, "App", GetPVarInt(playerid, "App"));
            DOF2_SetInt(string, "InvWeapon", GetPVarInt(playerid, "InvWeapon"));
            DOF2_SetInt(string, "InvAmmo", GetPVarInt(playerid, "InvAmmo"));
            DOF2_SetInt(string, "Clothes1", GetPVarInt(playerid, "Clothes1"));
            DOF2_SetInt(string, "Clothes2", GetPVarInt(playerid, "Clothes2"));
            DOF2_SetInt(string, "Clothes3", GetPVarInt(playerid, "Clothes3"));
            DOF2_SetInt(string, "Clothes4", GetPVarInt(playerid, "Clothes4"));
            DOF2_SetInt(string, "Clothes5", GetPVarInt(playerid, "Clothes5"));
            DOF2_SetInt(string, "Bait", GetPVarInt(playerid, "Bait"));
            DOF2_SetInt(string, "FishingRod", GetPVarInt(playerid, "FishingRod"));
            DOF2_SetInt(string, "FishLine", GetPVarInt(playerid, "FishLine"));
            DOF2_SetInt(string, "Lazer", GetPVarInt(playerid, "Lazer"));
            DOF2_SetInt(string, "Duty", GetPVarInt(playerid, "Duty"));
            DOF2_SetInt(string, "Ciggy", GetPVarInt(playerid, "Ciggy"));
            DOF2_SetInt(string, "Beer", GetPVarInt(playerid, "Beer"));
            DOF2_SetInt(string, "Wine", GetPVarInt(playerid, "Wine"));
            DOF2_SetInt(string, "Motel", GetPVarInt(playerid, "Motel"));
            DOF2_SetInt(string, "Contract", GetPVarInt(playerid, "Contract"));
            DOF2_SetInt(string, "HighType", GetPVarInt(playerid, "Hightype"));
            DOF2_SetInt(string, "HiddenNum", GetPVarInt(playerid, "HiddenNum"));
            DOF2_SetInt(string, "Watch", GetPVarInt(playerid, "Watch"));
            DOF2_SetInt(string, "Crashes", GetPVarInt(playerid, "Crashes"));
            DOF2_SetInt(string, "BreakKit", GetPVarInt(playerid, "BreakKit"));
            DOF2_SetInt(string, "RentCar", GetPVarInt(playerid, "RentCar"));
            DOF2_SetInt(string, "JobCar", GetPVarInt(playerid, "JobCar"));
            DOF2_SetInt(string, "PdSuspensionDay", PlayerInfo[playerid][pdSuspensionDay]);
            DOF2_SetInt(string, "PdSuspensionMonth", PlayerInfo[playerid][pdSuspensionMonth]);
            DOF2_SetInt(string, "PdSuspensionYear", PlayerInfo[playerid][pdSuspensionYear]);
            DOF2_SetInt(string, "IntEnter", GetPVarInt(playerid, "IntEnter"));
            DOF2_SetInt(string, "Logs", GetPVarInt(playerid, "Logs"));
            DOF2_SetInt(string, "Cuffed", GetPVarInt(playerid, "Cuffed"));
            DOF2_SetInt(string, "CuffedTime", GetPVarInt(playerid, "CuffTime"));
            DOF2_SetInt(string, "JobTime", GetPVarInt(playerid, "JobTime"));
            DOF2_SetInt(string, "Deaths", GetPVarInt(playerid, "Deaths"));
            DOF2_SetInt(string, "PMMsg", GetPVarInt(playerid, "PMMsg"));
            DOF2_SetInt(string, "CellCol", GetPVarInt(playerid, "CellCol"));
            DOF2_SetInt(string, "HudCol", GetPVarInt(playerid, "HudCol"));
            DOF2_SetInt(string, "HudHide", GetPVarInt(playerid, "HudHide"));
            DOF2_SetInt(string, "Wound", GetPVarInt(playerid, "Wound"));
            DOF2_SetInt(string, "Addiction", GetPVarInt(playerid, "Addiction"));
            DOF2_SetInt(string, "Bail", GetPVarInt(playerid, "Bail"));
            DOF2_SetInt(string, "LicGuns", GetPVarInt(playerid, "LicGuns"));
            DOF2_SetInt(string, "LicTime", GetPVarInt(playerid, "LicTime"));
            DOF2_SetInt(string, "Strikes", GetPVarInt(playerid, "Strikes"));
            DOF2_SetInt(string, "OOCStats", GetPVarInt(playerid, "OOCStats"));
            DOF2_SetInt(string, "FactPerm", GetPVarInt(playerid, "FactPerm"));
            DOF2_SetInt(string, "DuffleBag", GetPVarInt(playerid, "DuffleBag"));
            DOF2_SetInt(string, "DufMoney", GetPVarInt(playerid, "DufMoney"));
            DOF2_SetInt(string, "DufWeed", GetPVarInt(playerid, "DufWeed"));
            DOF2_SetInt(string, "DufCrack", GetPVarInt(playerid, "DufCrack"));
            DOF2_SetInt(string, "DufCocaine", GetPVarInt(playerid, "DufCocaine"));
            DOF2_SetInt(string, "DufGun1", GetPVarInt(playerid, "DufGun1"));
            DOF2_SetInt(string, "DufGun2", GetPVarInt(playerid, "DufGun2"));
            DOF2_SetInt(string, "DufGun3", GetPVarInt(playerid, "DufGun3"));
            DOF2_SetInt(string, "DufGun4", GetPVarInt(playerid, "DufGun4"));
            DOF2_SetInt(string, "DufGunA1", GetPVarInt(playerid, "DufGunA1"));
            DOF2_SetInt(string, "DufGunA2", GetPVarInt(playerid, "DufGunA2"));
            DOF2_SetInt(string, "DufGunA3", GetPVarInt(playerid, "DufGunA3"));
            DOF2_SetInt(string, "DufGunA4", GetPVarInt(playerid, "DufGunA4"));
            DOF2_SetInt(string, "GunLaw", GetPVarInt(playerid, "GunLaw"));
            DOF2_SetInt(string, "GunLawT", GetPVarInt(playerid, "GunLawT"));
            DOF2_SetInt(string, "Bomb", GetPVarInt(playerid, "Bomb"));
            DOF2_SetInt(string, "DrugUsage", GetPVarInt(playerid, "DrugUsage"));
            DOF2_SetInt(string, "DrugDay", GetPVarInt(playerid, "DrugDay"));
            DOF2_SetInt(string, "RingNum", GetPVarInt(playerid, "RingNum"));
            DOF2_SetInt(string, "Raise", GetPVarInt(playerid, "Raise"));
            //SetPVarInt(playerid, "SpouseKey", DOF2_GetInt(string, "SpouseKey"));
            //SetPVarInt(playerid, "HouseKey2", DOF2_GetInt(string, "HouseKey2"));
            // Floats //
            DOF2_SetFloat(string, "PosX", GetPVarFloat(playerid, "PosX"));
            DOF2_SetFloat(string, "PosY", GetPVarFloat(playerid, "PosY"));
            DOF2_SetFloat(string, "PosZ", GetPVarFloat(playerid, "PosZ"));
            DOF2_SetFloat(string, "Health", GetPVarFloat(playerid, "Health"));
            DOF2_SetFloat(string, "Armour", GetPVarFloat(playerid, "Armour"));
            // Strings //
            DOF2_SetString(string,  "AdmName", PlayerInfo[playerid][pAdmName]);
            DOF2_SetString(string,  "Accent", PlayerInfo[playerid][pAccent]);
            DOF2_SetString(string,  "Describe", PlayerInfo[playerid][pDescribe]);
            DOF2_SetString(string,  "BanReason", PlayerInfo[playerid][pBanReason]);
            DOF2_SetString(string,  "TicketReason1", TicketReason[playerid][0]);
            DOF2_SetString(string,  "TicketReason2", TicketReason[playerid][1]);
            DOF2_SetString(string,  "TicketReason3", TicketReason[playerid][2]);
            DOF2_SetString(string,  "TicketReason4", TicketReason[playerid][3]);
            DOF2_SetString(string,  "TicketReason5", TicketReason[playerid][4]);
            DOF2_SetString(string,  "Note1", PlayerInfo[playerid][pNote1]);
            DOF2_SetString(string,  "Note2", PlayerInfo[playerid][pNote2]);
            DOF2_SetString(string,  "Note3", PlayerInfo[playerid][pNote3]);
            DOF2_SetString(string,  "Note4", PlayerInfo[playerid][pNote4]);
            DOF2_SetString(string,  "Note5", PlayerInfo[playerid][pNote5]);
            DOF2_SetString(string,  "JailReason", PlayerInfo[playerid][pJailReason]);
            DOF2_SetString(string,  "Taunt", PlayerInfo[playerid][pTaunt]);
            DOF2_SetString(string,  "Warning", PlayerInfo[playerid][pWarning]);
            DOF2_SetString(string,  "MarriedTo", PlayerInfo[playerid][pMarriedTo]);
            DOF2_SetString(string,  "Warrant", PlayerInfo[playerid][pWarrant]);
            DOF2_SetString(string,  "Describe2", PlayerInfo[playerid][pDescribe2]);
            DOF2_SetString(string,  "Parole", PlayerInfo[playerid][pWarrant]);
            DOF2_SetString(string,  "MaskT", PlayerInfo[playerid][pMaskT]);
            DOF2_SetString(string,  "LBannedBy", PlayerInfo[playerid][pLBannedBy]);
        }
    }
    return 0;
}
Reply
#7

Someone Please?
Reply
#8

SOMEONE?
Reply
#9

create a callback before using GameModeExit, and put all the saving under it then do a timer for GameModeExit.
Reply
#10

First save everything then create a timer of atleast 1 or 2 seconds that restarts the server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)