Money Problem
#1

Hello, I have a problem on my script when a new player logs in he gets 5000. but if he spends it and then relogs he gets 5000 again. what could the problem be.
Reply
#2

You don't have saving system? You need saving system so it will save player money when he will disconnect..
Reply
#3

I do i don't have to register again it just keeps giving 5000 every time you log in.
Reply
#4

Post your login/register code.
Reply
#5

The first thing came to my mind is the variables. That you never reset their values on connect so new players get the stats of the previous players (if none is set to).

It may be giving money on connect, register or login though. You'll need to look it up.
Reply
#6

Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Hi your not registered", "Welcome, your not registered mate, input your registration password below", "", "Leave");
        dini_Create(file);
        dini_IntSet(file, "Password", PlayerInfo[playerid][pKey] = udb_hash(inputtext));
        dini_IntSet(file, "Admin",PlayerInfo[playerid][pAdmin] = 0);
        dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 5000);
        dini_IntSet(file, "Level",PlayerInfo[playerid][pLevel] = 1);
        dini_IntSet(file, "Bank",PlayerInfo[playerid][pBank] = 15000);
        dini_IntSet(file, "Experience",PlayerInfo[playerid][pExp] = 0);
        dini_IntSet(file, "Watch",PlayerInfo[playerid][pWatch] = 0);
        dini_IntSet(file, "NumberChanges",PlayerInfo[playerid][pNChanges] = 0);
        dini_IntSet(file, "PhoneChanges",PlayerInfo[playerid][pPChanges] = 0);
        dini_IntSet(file, "Rope",PlayerInfo[playerid][pRope] = 0);
        dini_IntSet(file, "DonatorLevel",PlayerInfo[playerid][pDonor] = 15000);
        dini_IntSet(file, "NameChanges",PlayerInfo[playerid][pNameChanges] = 15000);
        dini_IntSet(file, "Backup",PlayerInfo[playerid][pRequestingBackup] = 0);
        dini_IntSet(file, "Sex",PlayerInfo[playerid][pSex] = 0);
        dini_IntSet(file, "Savings",PlayerInfo[playerid][pSavings] = 0);
        dini_IntSet(file, "Gang",PlayerInfo[playerid][pGang] = 0);
        dini_IntSet(file, "GangRank",PlayerInfo[playerid][pGangRank] = 0);
        dini_IntSet(file, "GangLeader",PlayerInfo[playerid][pGangLeader] = 0);
        dini_IntSet(file, "DistrictR",PlayerInfo[playerid][pDistrictR] = 0);
        dini_IntSet(file, "Age",PlayerInfo[playerid][pAge] = 0);
        dini_IntSet(file, "Sellings",PlayerInfo[playerid][pSellings] = 2);
        dini_IntSet(file, "Armor",PlayerInfo[playerid][pArmor] = 0);
        dini_IntSet(file, "Health",PlayerInfo[playerid][pHealth] = 100);
        dini_IntSet(file, "Melee",PlayerInfo[playerid][pKills] = 0);
        dini_IntSet(file, "DrugPerk",PlayerInfo[playerid][pDrugPerk] = 0);
        dini_IntSet(file, "Fuel",PlayerInfo[playerid][pFuel] = 0);
        dini_IntSet(file, "Continent",PlayerInfo[playerid][pPlace] = 0);
        dini_IntSet(file, "TazerBullets",PlayerInfo[playerid][pTazerBullets] = 15000);
        dini_IntSet(file, "Mask",PlayerInfo[playerid][pMask] = 0);
        dini_IntSet(file, "Maskuse",PlayerInfo[playerid][pMaskuse] = 0);
        dini_IntSet(file, "MaskReplacement",PlayerInfo[playerid][pMaskReplacement] = 0);
        dini_IntSet(file, "AdminDuty",PlayerInfo[playerid][pAdminDuty] = 0);
        dini_IntSet(file, "Muted",PlayerInfo[playerid][pMuted] = 0);
        dini_IntSet(file, "WantedDeaths",PlayerInfo[playerid][pWantedDeaths] = 0);
        dini_IntSet(file, "JailTime",PlayerInfo[playerid][pJailTime] = 0);
        dini_IntSet(file, "Jailed",PlayerInfo[playerid][pJailed] = 0);
        dini_IntSet(file, "PrisonNr",PlayerInfo[playerid][pPrisonNr] = 0);
        dini_IntSet(file, "Payday",PlayerInfo[playerid][pPayCheck] = 0);
        dini_IntSet(file, "Wanted",PlayerInfo[playerid][pWanted] = 0);
        dini_IntSet(file, "WLevel",PlayerInfo[playerid][pWantedLevel] = 0);
		strmid(PlayerInfo[playerid][pCrimeReason], "None", 0, strlen("None"), 255);
        dini_IntSet(file, "Crimes",PlayerInfo[playerid][pCrimes] = 0);
        dini_IntSet(file, "Arrested",PlayerInfo[playerid][pArrested] = 0);
        dini_IntSet(file, "Member", PlayerInfo[playerid][pMember] = 0);
        dini_IntSet(file, "Rank", PlayerInfo[playerid][pRank] = 0);
        dini_IntSet(file, "Team", PlayerInfo[playerid][pTeam] = 0);
        dini_IntSet(file, "Leader", PlayerInfo[playerid][pLeader] = 0);
		new rp = 100000 + random(899999);
        dini_IntSet(file, "Ph", PlayerInfo[playerid][pPnumber] = rp);
        dini_IntSet(file, "Job", PlayerInfo[playerid][pJob] = 0);
        dini_IntSet(file, "Materials", PlayerInfo[playerid][pMats] = 0);
        dini_IntSet(file, "Components", PlayerInfo[playerid][pComps] = 0);
        dini_IntSet(file, "Weapon1", PlayerInfo[playerid][pWeapon1] = 0);
        dini_IntSet(file, "WAmmo1", PlayerInfo[playerid][pWAmmo1] = 0);
        dini_IntSet(file, "Weapon2", PlayerInfo[playerid][pWeapon2] = 0);
        dini_IntSet(file, "WAmmo2", PlayerInfo[playerid][pWAmmo2] = 0);
        dini_IntSet(file, "Weapon3", PlayerInfo[playerid][pWeapon3] = 0);
        dini_IntSet(file, "WAmmo3", PlayerInfo[playerid][pWAmmo3] = 0);
        dini_IntSet(file, "Drugs", PlayerInfo[playerid][pDrugs] = 0);
        dini_IntSet(file, "CarKey", PlayerInfo[playerid][pPcarkey] = 9999);
        dini_IntSet(file, "CarKey2", PlayerInfo[playerid][pPcarkey2] = 9999);
        dini_IntSet(file, "Carlic", PlayerInfo[playerid][pCarLic] = 0);
        dini_IntSet(file, "Warned", PlayerInfo[playerid][pWarned] = 0);
        dini_IntSet(file, "Boatlic", PlayerInfo[playerid][pBoatLic] = 0);
        dini_IntSet(file, "Flylic", PlayerInfo[playerid][pFlyLic] = 0);
        dini_IntSet(file, "GunLic", PlayerInfo[playerid][pGunLic] = 0);
        dini_IntSet(file, "SailLic", PlayerInfo[playerid][pSailLic] = 0);
        dini_IntSet(file, "HouseKey", PlayerInfo[playerid][pPhousekey] = 0);
        dini_IntSet(file, "RentingHouse", PlayerInfo[playerid][pRentingH] = 0);
        dini_IntSet(file, "BizKey", PlayerInfo[playerid][pPbiskey] = 9999);
        dini_IntSet(file, "Married", PlayerInfo[playerid][pMarried] = 0);
        dini_IntSet(file, "Married To", PlayerInfo[playerid][pMarriedTo] = 0);
        dini_IntSet(file, "Local", PlayerInfo[playerid][pLocal] = 255);
        dini_IntSet(file, "Virtual", PlayerInfo[playerid][pVirWorld] = 0);
        dini_IntSet(file, "RadioC", PlayerInfo[playerid][pRadioC] = 0);
        dini_IntSet(file, "Radio", PlayerInfo[playerid][pRadio] = 0);
        dini_IntSet(file, "Interior", PlayerInfo[playerid][pInteriorNr] = 0);
        dini_IntSet(file, "Tutorial", PlayerInfo[playerid][pTutorial] = 0);
        dini_IntSet(file, "Selected", PlayerInfo[playerid][pSelected] = 0);
        dini_IntSet(file, "Character", PlayerInfo[playerid][pCharacter] = 23);
        dini_IntSet(file, "Spawn", PlayerInfo[playerid][pSpawn] = 0);
        dini_IntSet(file, "Duty", PlayerInfo[playerid][pDuty] = 0);
       	dini_IntSet(file, "BannedUser", PlayerInfo[playerid][pBanned]);
		dini_IntSet(file, "Package1", PlayerInfo[playerid][pPackage1] = 0);
		dini_IntSet(file, "Package2", PlayerInfo[playerid][pPackage2] = 0);
		dini_IntSet(file, "Package3", PlayerInfo[playerid][pPackage3] = 0);
		dini_IntSet(file, "Package4", PlayerInfo[playerid][pPackage4] = 0);
		dini_IntSet(file, "pPackage5", PlayerInfo[playerid][pPackage5] = 0);
		dini_IntSet(file, "Package1Ammo", PlayerInfo[playerid][pPackage1Ammo] = 0);
		dini_IntSet(file, "Package2Ammo", PlayerInfo[playerid][pPackage2Ammo] = 0);
		dini_IntSet(file, "Package3Ammo", PlayerInfo[playerid][pPackage3Ammo] = 0);
		dini_IntSet(file, "Package4Ammo", PlayerInfo[playerid][pPackage4Ammo] = 0);
		dini_IntSet(file, "Package5Ammo", PlayerInfo[playerid][pPackage5Ammo] = 0);
       	dini_IntSet(file, "ContractTime", PlayerInfo[playerid][pContractT]);
        format(string, 128, "[SERVER]: Welcome to San Fierro Role Play%s ,your password is %s", name, inputtext);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        gPlayerLogged[playerid] = 1;
        new y,m,d;
		new h,mi,s;
		getdate(y,m,d);
		gettime(h,mi,s);
		format(string,sizeof(string), "(%d/%d/%d) [%d:%d:%d] %s Has registred in under IP %s.",d,m,y,h,mi,s,name,playersip);
		Log(string);
    }
Reply
#7

Show me your login process. (just like above)
Reply
#8

Send your login code also.
Reply
#9

Код:
public OnPlayerLogin(playerid,password[])
{
	new	string2[64];
    new	string[128];
	new	playername2[MAX_PLAYER_NAME];
	new playersip[24];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    GetPlayerIp(playerid, playersip, sizeof(playersip));
    format(string2, sizeof(string2), "SF-RP/Accounts/%s.ini", playername2);
   	gPlayerLogged[playerid] = 1;
    new file[256];
    format(file, sizeof(file), USERS_FILES, playername2);
   	if (dini_Exists(string2))
	{
	    PlayerInfo[playerid][pKey] = dini_Int(string2,"Password");
 		PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin");
   		PlayerInfo[playerid][pLevel] = dini_Int(file, "Level");
   		PlayerInfo[playerid][pCash] = dini_Int(file, "Money");
   		PlayerInfo[playerid][pBank] = dini_Int(file, "Bank");
   		PlayerInfo[playerid][pExp] = dini_Int(file, "Experience");
   		PlayerInfo[playerid][pWatch] = dini_Int(file, "Watch");
   		PlayerInfo[playerid][pNChanges] = dini_Int(file, "NumberChanges");
   		PlayerInfo[playerid][pPChanges] = dini_Int(file, "PhoneChanges");
   		PlayerInfo[playerid][pRope] = dini_Int(file, "Rope");
   		PlayerInfo[playerid][pNameChanges] = dini_Int(file, "NameChanges");
   		PlayerInfo[playerid][pDonor] = dini_Int(file, "DonatorLevel");
   		PlayerInfo[playerid][pRequestingBackup] = dini_Int(file, "Backup");
   		PlayerInfo[playerid][pSex] = dini_Int(file, "Sex");
   		PlayerInfo[playerid][pSavings] = dini_Int(file, "Savings");
   		PlayerInfo[playerid][pGang] = dini_Int(file, "Gang");
   		PlayerInfo[playerid][pGangLeader] = dini_Int(file, "GangLeader");
   		PlayerInfo[playerid][pGangRank] = dini_Int(file, "GangRank");
   		PlayerInfo[playerid][pDistrictR] = dini_Int(file, "DistrictR");
   		PlayerInfo[playerid][pAge] = dini_Int(file, "Age");
   		PlayerInfo[playerid][pSellings] = dini_Int(file, "Sellings");
   		PlayerInfo[playerid][pArmor] = dini_Int(file, "Armor");
   		PlayerInfo[playerid][pHealth] = dini_Int(file, "Health");
   		PlayerInfo[playerid][pKills] = dini_Int(file, "Melee");
   		PlayerInfo[playerid][pDrugPerk] = dini_Int(file, "DrugPerk");
   		PlayerInfo[playerid][pFuel] = dini_Int(file, "Fuel");
   		PlayerInfo[playerid][pPlace] = dini_Int(file, "Continent");
   		PlayerInfo[playerid][pTazerBullets] = dini_Int(file, "TazerBullets");
   		PlayerInfo[playerid][pMask] = dini_Int(file, "Mask");
   		PlayerInfo[playerid][pMaskuse] = dini_Int(file, "Maskuse");
   		PlayerInfo[playerid][pMaskReplacement] = dini_Int(file, "MaskReplacement");
   		PlayerInfo[playerid][pAdminDuty] = dini_Int(file, "AdminDuty");
   		PlayerInfo[playerid][pWantedDeaths] = dini_Int(file, "WantedDeaths");
   		PlayerInfo[playerid][pJailTime] = dini_Int(file, "JailTime");
   		PlayerInfo[playerid][pJailed] = dini_Int(file, "Jailed");
   		PlayerInfo[playerid][pPrisonNr] = dini_Int(file, "PrisonNr");
   		PlayerInfo[playerid][pPayCheck] = dini_Int(file, "PayDay");
   		PlayerInfo[playerid][pWanted] = dini_Int(file, "Wanted");
   		PlayerInfo[playerid][pWantedLevel] = dini_Int(file, "WLevel");
	    strmid(PlayerInfo[playerid][pCrimeReason],dini_Get(string2,"CrimeReason"),0,strlen(dini_Get(string2,"CrimeReason")),255);
   		PlayerInfo[playerid][pCrimes] = dini_Int(file, "Crimes");
   		PlayerInfo[playerid][pArrested] = dini_Int(file, "Arrested");
   		PlayerInfo[playerid][pMember] = dini_Int(file, "Member");
   		PlayerInfo[playerid][pRank] = dini_Int(file, "Rank");
   		PlayerInfo[playerid][pTeam] = dini_Int(file, "Team");
   		PlayerInfo[playerid][pLeader] = dini_Int(file, "Leader");
   		PlayerInfo[playerid][pPnumber] = dini_Int(file, "Ph");
   		PlayerInfo[playerid][pJob] = dini_Int(file, "Job");
   		PlayerInfo[playerid][pMats] = dini_Int(file, "Materials");
   		PlayerInfo[playerid][pComps] = dini_Int(file, "Components");
   		PlayerInfo[playerid][pWeapon1] = dini_Int(file, "Weapon1");
   		PlayerInfo[playerid][pWAmmo1] = dini_Int(file, "WAmmo1");
   		PlayerInfo[playerid][pWeapon2] = dini_Int(file, "Weapon2");
   		PlayerInfo[playerid][pWAmmo2] = dini_Int(file, "WAmmo2");
   		PlayerInfo[playerid][pWeapon3] = dini_Int(file, "Weapon3");
   		PlayerInfo[playerid][pWAmmo3] = dini_Int(file, "WAmmo3");
   		PlayerInfo[playerid][pDrugs] = dini_Int(file, "Drugs");
   		PlayerInfo[playerid][pPcarkey] = dini_Int(file, "CarKey");
   		PlayerInfo[playerid][pPcarkey2] = dini_Int(file, "CarKey2");
   		PlayerInfo[playerid][pCarLic] = dini_Int(file, "Carlic");
   		PlayerInfo[playerid][pWarned] = dini_Int(file, "Warned");
   		PlayerInfo[playerid][pBoatLic] = dini_Int(file, "Boatlic");
   		PlayerInfo[playerid][pFlyLic] = dini_Int(file, "Flylic");
   		PlayerInfo[playerid][pGunLic] = dini_Int(file, "GunLic");
   		PlayerInfo[playerid][pSailLic] = dini_Int(file, "SailLic");
   		PlayerInfo[playerid][pPhousekey] = dini_Int(file, "HouseKey");
   		PlayerInfo[playerid][pRentingH] = dini_Int(file, "RentingHouse");
   		PlayerInfo[playerid][pPbiskey] = dini_Int(file, "BizKey");
   		PlayerInfo[playerid][pMarried] = dini_Int(file, "Married");
   		PlayerInfo[playerid][pMarriedTo] = dini_Int(file, "Married To");
   		PlayerInfo[playerid][pVirWorld] = dini_Int(file, "Virtual");
   		PlayerInfo[playerid][pRadioC] = dini_Int(file, "RadioC");
   		PlayerInfo[playerid][pRadio] = dini_Int(file, "Radio");
   		PlayerInfo[playerid][pInteriorNr] = dini_Int(file, "Interior");
   		PlayerInfo[playerid][pTutorial] = dini_Int(file, "Tutorial");
   		PlayerInfo[playerid][pSelected] = dini_Int(file, "Selected");
   		PlayerInfo[playerid][pCharacter] = dini_Int(file, "Character");
   		PlayerInfo[playerid][pSpawn] = dini_Int(file, "Spawn");
   		PlayerInfo[playerid][pDuty] = dini_Int(file, "Duty");
   		PlayerInfo[playerid][pBanned] = dini_Int(file, "BannedUser");
		PlayerInfo[playerid][pPackage1] = dini_Int(file, "Package1");
		PlayerInfo[playerid][pPackage2] = dini_Int(file, "Package2");
		PlayerInfo[playerid][pPackage3] = dini_Int(file, "Package3");
		PlayerInfo[playerid][pPackage4] = dini_Int(file, "Package4");
		PlayerInfo[playerid][pPackage5] = dini_Int(file, "pPackage5");
		PlayerInfo[playerid][pPackage1Ammo] = dini_Int(file, "Package1Ammo");
		PlayerInfo[playerid][pPackage2Ammo] = dini_Int(file, "Package2Ammo");
		PlayerInfo[playerid][pPackage3Ammo] = dini_Int(file, "Package3Ammo");
		PlayerInfo[playerid][pPackage4Ammo] = dini_Int(file, "Package4Ammo");
		PlayerInfo[playerid][pPackage5Ammo] = dini_Int(file, "Package5Ammo");
   		PlayerInfo[playerid][pContractT] = dini_Int(file, "ContractTime");
       	SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
      	gPlayerLogged[playerid] = 1;
Reply
#10

I don't think that the problem is here.. I can't really see anything regarding money except for saving/loading its value.
Perhaps can you show us where have you added GivePlayerMoney at your script/where it is being used? (in case you're not having an anti money spawn system)
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)