17.03.2016, 15:05
Right i have worked out that my dini system is loading the stats when you connect but when you spawn it seems like its reseting them....
Any sugestions?
Any sugestions?
public OnPlayerConnect(playerid) { gPlayerLogged[playerid] = 0; SetPlayerColor(playerid, COLOR_WHITE); TogglePlayerSpectating(playerid, true); new playername[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, playername, sizeof(playername)); format(file, sizeof(file), SERVER_USER_FILE, playername); SendClientMessage(playerid, COLOR_WHITE, "Welcome To Las Vegas Reality Roleplay"); if(dini_Exists(file)) { PlayerInfo[playerid][pRegistered] = dini_Int(file, "Registered"); PlayerInfo[playerid][pMoney] = dini_Int(file, "Money"); PlayerInfo[playerid][pSkin] = dini_Int(file, "Skin"); PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel"); PlayerInfo[playerid][pJailTime] = dini_Int(file, "JailTime"); PlayerInfo[playerid][pHealth] = dini_Float(file, "Health"); PlayerInfo[playerid][pArmour] = dini_Float(file, "Armour"); PlayerInfo[playerid][pPhone] = dini_Int(file, "Phone"); PlayerInfo[playerid][pBank] = dini_Int(file, "Bank"); AdminDuty[playerid] = 0; SetTimerEx("TrashTimer", 1500000, 1, "i", playerid); JackingCar[playerid] = 0; Logging[playerid] = 0; GettingJob[playerid] = 0; Farming[playerid] = 0; PlantingSeeds[playerid] = 0; GrowingCrops[playerid] = 0; FarmingCrops[playerid] = -1; CollectingTrash[playerid] = 0; CollectingTrash1[playerid] = 0; CollectingTrash2[playerid] = 0; CollectingTrash3[playerid] = 0; CollectingTrash4[playerid] = 0; CollectingTrash5[playerid] = 0; CollectingTrash6[playerid] = 0; CollectingTrash7[playerid] = 0; CollectingTrash8[playerid] = 0; CollectingTrash9[playerid] = 0; CollectingTrash10[playerid] = 0; CollectingTrash11[playerid] = 0; CollectingTrash12[playerid] = 0; CollectingTrash13[playerid] = 0; oldcar[playerid] = 0; HandsupPlayer[playerid] = 0; EatingFood[playerid] = 0; DeliveryTruck[playerid] = 0; PlayerTied[playerid] = 0; ShotPlayer[playerid] = 0; SmuggleDropOff[playerid] = 0; PlayerCuffed[playerid] = 0; CellTime[playerid] = 0; PlayerRestrained[playerid] = 0; RentedCar[playerid] = 0; HoldingObject[playerid] = 0; PhoneOnline[playerid] = 0; Mobile[playerid] = INVALID_PLAYER_ID; Spectating[playerid] = 0; RingTone[playerid] = 0; CopDuty[playerid] = 0; TazerCharged[playerid] = 0; Tazer[playerid] = 0; SmugglingMats[playerid] = 0; SetPlayerColor(playerid, COLOR_WHITE); GettingPacks[playerid] = 0; ResetPlayerMoney(playerid); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Welcome Back", " Welcome Back, This Account Is Registered \n Please Type Your Password Below To Continue: \n", "Login", "Quit"); } else if (!dini_Exists(file)) { SendClientMessage(playerid, COLOR_BLUE, " [-Fort Carson Immigration-] "); SendClientMessage(playerid, COLOR_WHITE, " We Cannot Seem To Find A File "); SendClientMessage(playerid, COLOR_WHITE, " On You, Please Fill In This Information "); ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Welcome To Fort Carson", " Welcome, This Account Is Not Registered \n Please Type Your Desired Password Below To Continue: \n", "Register", "Cancle"); AdminDuty[playerid] = 0; } return 1; } forward TrashTimer(playerid); public TrashTimer(playerid) { CollectingTrash1[playerid] = 0; CollectingTrash2[playerid] = 0; CollectingTrash3[playerid] = 0; CollectingTrash4[playerid] = 0; CollectingTrash5[playerid] = 0; CollectingTrash6[playerid] = 0; CollectingTrash7[playerid] = 0; CollectingTrash8[playerid] = 0; CollectingTrash9[playerid] = 0; CollectingTrash10[playerid] = 0; CollectingTrash11[playerid] = 0; CollectingTrash12[playerid] = 0; CollectingTrash13[playerid] = 0; return 1; } public OnPlayerSpawn(playerid) { SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); SetPlayerMoney(playerid, PlayerInfo[playerid][pMoney]); return 1; } public OnPlayerDisconnect(playerid, reason) { new playername[MAX_PLAYER_NAME], file[256]; new Float:Health, Float:Armour; GetPlayerName(playerid, playername, sizeof(playername)); format(file, sizeof(file), SERVER_USER_FILE, playername); gPlayerLogged[playerid] = 0; if(dini_Exists(file)) { dini_IntSet(file, "Money", PlayerInfo[playerid][pMoney]); dini_IntSet(file, "Bank", PlayerInfo[playerid][pBank]); GetPlayerHealth(playerid, Health); PlayerInfo[playerid][pHealth] = Health; dini_FloatSet(file, "Health",PlayerInfo[playerid][pHealth]); GetPlayerArmour(playerid, Armour); PlayerInfo[playerid][pArmour] = Armour; dini_IntSet(file, "Skin",PlayerInfo[playerid][pSkin]); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]); dini_FloatSet(file, "Armour",PlayerInfo[playerid][pArmour]); dini_IntSet(file, "Origin",PlayerInfo[playerid][pOrigin]); dini_IntSet(file, "Accent",PlayerInfo[playerid][pAccent]); dini_IntSet(file, "Job",PlayerInfo[playerid][pJob]); dini_IntSet(file, "Faction",PlayerInfo[playerid][pFaction]); dini_IntSet(file, "Rank",PlayerInfo[playerid][pRank]); dini_IntSet(file, "License",PlayerInfo[playerid][pLicense]); dini_IntSet(file, "Cocaine",PlayerInfo[playerid][pCocaine]); dini_IntSet(file, "Marijuana",PlayerInfo[playerid][pMarijuana]); dini_IntSet(file, "Donater",PlayerInfo[playerid][pDonater]); dini_IntSet(file, "DonaterPoints",PlayerInfo[playerid][pDonaterPoints]); dini_IntSet(file, "Watch",PlayerInfo[playerid][pWatch]); dini_IntSet(file, "Phone",PlayerInfo[playerid][pPhone]); dini_IntSet(file, "PhoneNumber",PlayerInfo[playerid][pPhoneNumber]); dini_IntSet(file, "Cigars",PlayerInfo[playerid][pCigars]); dini_IntSet(file, "House",PlayerInfo[playerid][pHouse]); dini_IntSet(file, "Lighter",PlayerInfo[playerid][pLighter]); dini_IntSet(file, "Mask",PlayerInfo[playerid][pMask]); dini_IntSet(file, "JailTime", PlayerInfo[playerid][pJailTime]); dini_IntSet(file, "WeaponSlot1", PlayerInfo[playerid][pGun01]); dini_IntSet(file, "WeaponSlot2", PlayerInfo[playerid][pGun02]); dini_IntSet(file, "WeaponSlot3", PlayerInfo[playerid][pGun03]); dini_IntSet(file, "WeaponSlot4", PlayerInfo[playerid][pGun04]); dini_IntSet(file, "WeaponSlot5", PlayerInfo[playerid][pGun05]); dini_IntSet(file, "WeaponSlot6", PlayerInfo[playerid][pGun06]); dini_IntSet(file, "WeaponSlot7", PlayerInfo[playerid][pGun07]); dini_IntSet(file, "WeaponSlot8", PlayerInfo[playerid][pGun08]); dini_IntSet(file, "WeaponSlot9", PlayerInfo[playerid][pGun09]); dini_IntSet(file, "WeaponSlot11", PlayerInfo[playerid][pGun11]); } return 1; }
public OnPlayerConnect(playerid) { gPlayerLogged[playerid] = 0; SetPlayerColor(playerid, COLOR_WHITE); TogglePlayerSpectating(playerid, true); new playername[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, playername, sizeof(playername)); format(file, sizeof(file), SERVER_USER_FILE, playername); SendClientMessage(playerid, COLOR_WHITE, "Welcome To Las Vegas Reality Roleplay"); if(dini_Exists(file)) { PlayerInfo[playerid][pRegistered] = dini_Int(file, "Registered"); PlayerInfo[playerid][pMoney] = dini_Int(file, "Money"); PlayerInfo[playerid][pSkin] = dini_Int(file, "Skin"); PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel"); PlayerInfo[playerid][pJailTime] = dini_Int(file, "JailTime"); PlayerInfo[playerid][pHealth] = dini_Float(file, "Health"); PlayerInfo[playerid][pArmour] = dini_Float(file, "Armour"); PlayerInfo[playerid][pPhone] = dini_Int(file, "Phone"); PlayerInfo[playerid][pBank] = dini_Int(file, "Bank"); AdminDuty[playerid] = 0; SetTimerEx("TrashTimer", 1500000, 1, "i", playerid); JackingCar[playerid] = 0; Logging[playerid] = 0; GettingJob[playerid] = 0; Farming[playerid] = 0; PlantingSeeds[playerid] = 0; GrowingCrops[playerid] = 0; FarmingCrops[playerid] = -1; CollectingTrash[playerid] = 0; CollectingTrash1[playerid] = 0; CollectingTrash2[playerid] = 0; CollectingTrash3[playerid] = 0; CollectingTrash4[playerid] = 0; CollectingTrash5[playerid] = 0; CollectingTrash6[playerid] = 0; CollectingTrash7[playerid] = 0; CollectingTrash8[playerid] = 0; CollectingTrash9[playerid] = 0; CollectingTrash10[playerid] = 0; CollectingTrash11[playerid] = 0; CollectingTrash12[playerid] = 0; CollectingTrash13[playerid] = 0; oldcar[playerid] = 0; HandsupPlayer[playerid] = 0; EatingFood[playerid] = 0; DeliveryTruck[playerid] = 0; PlayerTied[playerid] = 0; ShotPlayer[playerid] = 0; SmuggleDropOff[playerid] = 0; PlayerCuffed[playerid] = 0; CellTime[playerid] = 0; PlayerRestrained[playerid] = 0; RentedCar[playerid] = 0; HoldingObject[playerid] = 0; PhoneOnline[playerid] = 0; Mobile[playerid] = INVALID_PLAYER_ID; Spectating[playerid] = 0; RingTone[playerid] = 0; CopDuty[playerid] = 0; TazerCharged[playerid] = 0; Tazer[playerid] = 0; SmugglingMats[playerid] = 0; SetPlayerColor(playerid, COLOR_WHITE); GettingPacks[playerid] = 0; ResetPlayerMoney(playerid); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Welcome Back", " Welcome Back, This Account Is Registered \n Please Type Your Password Below To Continue: \n", "Login", "Quit"); } else if (!dini_Exists(file)) { SendClientMessage(playerid, COLOR_BLUE, " [-Fort Carson Immigration-] "); SendClientMessage(playerid, COLOR_WHITE, " We Cannot Seem To Find A File "); SendClientMessage(playerid, COLOR_WHITE, " On You, Please Fill In This Information "); ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Welcome To Fort Carson", " Welcome, This Account Is Not Registered \n Please Type Your Desired Password Below To Continue: \n", "Register", "Cancle"); AdminDuty[playerid] = 0; } return 1; } forward TrashTimer(playerid); public TrashTimer(playerid) { CollectingTrash1[playerid] = 0; CollectingTrash2[playerid] = 0; CollectingTrash3[playerid] = 0; CollectingTrash4[playerid] = 0; CollectingTrash5[playerid] = 0; CollectingTrash6[playerid] = 0; CollectingTrash7[playerid] = 0; CollectingTrash8[playerid] = 0; CollectingTrash9[playerid] = 0; CollectingTrash10[playerid] = 0; CollectingTrash11[playerid] = 0; CollectingTrash12[playerid] = 0; CollectingTrash13[playerid] = 0; return 1; } public OnPlayerSpawn(playerid) { SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); SetPlayerMoney(playerid, PlayerInfo[playerid][pMoney]); return 1; } public OnPlayerDisconnect(playerid, reason) { new playername[MAX_PLAYER_NAME], file[256]; new Float:Health, Float:Armour; GetPlayerName(playerid, playername, sizeof(playername)); format(file, sizeof(file), SERVER_USER_FILE, playername); gPlayerLogged[playerid] = 0; if(dini_Exists(file)) { dini_IntSet(file, "Money", PlayerInfo[playerid][pMoney]); dini_IntSet(file, "Bank", PlayerInfo[playerid][pBank]); GetPlayerHealth(playerid, Health); PlayerInfo[playerid][pHealth] = Health; dini_FloatSet(file, "Health",PlayerInfo[playerid][pHealth]); GetPlayerArmour(playerid, Armour); PlayerInfo[playerid][pArmour] = Armour; dini_IntSet(file, "Skin",PlayerInfo[playerid][pSkin]); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]); dini_FloatSet(file, "Armour",PlayerInfo[playerid][pArmour]); dini_IntSet(file, "Origin",PlayerInfo[playerid][pOrigin]); dini_IntSet(file, "Accent",PlayerInfo[playerid][pAccent]); dini_IntSet(file, "Job",PlayerInfo[playerid][pJob]); dini_IntSet(file, "Faction",PlayerInfo[playerid][pFaction]); dini_IntSet(file, "Rank",PlayerInfo[playerid][pRank]); dini_IntSet(file, "License",PlayerInfo[playerid][pLicense]); dini_IntSet(file, "Cocaine",PlayerInfo[playerid][pCocaine]); dini_IntSet(file, "Marijuana",PlayerInfo[playerid][pMarijuana]); dini_IntSet(file, "Donater",PlayerInfo[playerid][pDonater]); dini_IntSet(file, "DonaterPoints",PlayerInfo[playerid][pDonaterPoints]); dini_IntSet(file, "Watch",PlayerInfo[playerid][pWatch]); dini_IntSet(file, "Phone",PlayerInfo[playerid][pPhone]); dini_IntSet(file, "PhoneNumber",PlayerInfo[playerid][pPhoneNumber]); dini_IntSet(file, "Cigars",PlayerInfo[playerid][pCigars]); dini_IntSet(file, "House",PlayerInfo[playerid][pHouse]); dini_IntSet(file, "Lighter",PlayerInfo[playerid][pLighter]); dini_IntSet(file, "Mask",PlayerInfo[playerid][pMask]); dini_IntSet(file, "JailTime", PlayerInfo[playerid][pJailTime]); dini_IntSet(file, "WeaponSlot1", PlayerInfo[playerid][pGun01]); dini_IntSet(file, "WeaponSlot2", PlayerInfo[playerid][pGun02]); dini_IntSet(file, "WeaponSlot3", PlayerInfo[playerid][pGun03]); dini_IntSet(file, "WeaponSlot4", PlayerInfo[playerid][pGun04]); dini_IntSet(file, "WeaponSlot5", PlayerInfo[playerid][pGun05]); dini_IntSet(file, "WeaponSlot6", PlayerInfo[playerid][pGun06]); dini_IntSet(file, "WeaponSlot7", PlayerInfo[playerid][pGun07]); dini_IntSet(file, "WeaponSlot8", PlayerInfo[playerid][pGun08]); dini_IntSet(file, "WeaponSlot9", PlayerInfo[playerid][pGun09]); dini_IntSet(file, "WeaponSlot11", PlayerInfo[playerid][pGun11]); } return 1; }