Guys Need Function :'((((

Started by Mohamed Boubekri, Nov 03, 2017, 09:11 PM

Previous topic - Next topic

Mohamed Boubekri

im downloading money system its work
but if me leave game cash not saveed but level and car and ban all saved allll work.
Need : Function Save Cash

Command : else if ( cmd =="setmon" )
{
if (!text) MessagePlayer("Syntax - /setmon <nick/id> <amount>",player);
else
{
local plr = GetPlayer( GetTok(text," ",1)), mon = GetTok(text," ",2);
if (!plr) MessagePlayer("Invalid Player",player);
else if (!mon) MessagePlayer("Money not specified",player);
else if (!IsNum(mon)) MessagePlayer("Money must be in number",player);
else
{
pstats[ plr.ID ].Cash += mon.tointeger();
player.Cash = pstats[plr.ID].Cash;
Message("Admin "+player.Name+" Has given "+mon+" $ to "+plr.Name+"");
}
}
}

Noteee :    Using Fuzzi Account System
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

D4rkR420R

That's because you need to save the player's cash to the database as well. You're setting his cash temporarily.

Mohamed Boubekri

#2
Quote from: KuRiMi on Nov 03, 2017, 10:05 PMThat's because you need to save the player's cash to the database as well. You're setting his cash temporarily.
KuRiMi Example? i Cant Understand :v
The Fuzzi Account System Save Stats or No?
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

umar4911

To explain, Suppose there are 2 types of storage in the server. One is temporary and one is permanent. If I player kills another player and cash is added in temporary memory, it will be removed on player reconnect. If cash is only added in permanent memory, nothing will be shown but after player reconnect, the result will be displayed. If the cash is added in both permanent and temporary memory than the desired output will be saved that the result will be same even after player reconnect.

I read some code of Fuzzie account. There is a line pstats[player.ID]... This is the temporary memory and where QuerySQL(........); is used, it will be permanent memory. You need to save anything e.g. cash, level, name, etc, store that in both but Remember to use the both temporary memory and permanent memory when the player is online. If player is offline, then use only permanent memory.
I am gamer, programmer and hacker. Try to find me!
xD

D4rkR420R

Quote from: umar4911 on Nov 06, 2017, 04:17 PMTo explain, Suppose there are 2 types of storage in the server. One is temporary and one is permanent. If I player kills another player and cash is added in temporary memory, it will be removed on player reconnect. If cash is only added in permanent memory, nothing will be shown but after player reconnect, the result will be displayed. If the cash is added in both permanent and temporary memory than the desired output will be saved that the result will be same even after player reconnect.

I read some code of Fuzzie account. There is a line pstats[player.ID]... This is the temporary memory and where QuerySQL(........); is used, it will be permanent memory. You need to save anything e.g. cash, level, name, etc, store that in both but Remember to use the both temporary memory and permanent memory when the player is online. If player is offline, then use only permanent memory.

Thanks for making it him easier :c

Mohamed Boubekri

Quote from: umar4911 on Nov 06, 2017, 04:17 PMTo explain, Suppose there are 2 types of storage in the server. One is temporary and one is permanent. If I player kills another player and cash is added in temporary memory, it will be removed on player reconnect. If cash is only added in permanent memory, nothing will be shown but after player reconnect, the result will be displayed. If the cash is added in both permanent and temporary memory than the desired output will be saved that the result will be same even after player reconnect.

I read some code of Fuzzie account. There is a line pstats[player.ID]... This is the temporary memory and where QuerySQL(........); is used, it will be permanent memory. You need to save anything e.g. cash, level, name, etc, store that in both but Remember to use the both temporary memory and permanent memory when the player is online. If player is offline, then use only permanent memory.
Thanks Bro @umar4911 :D im Happy Bcz im Got it. And Now Me Can Save Cash Just im Added The Line For Command Setmoney
And Its Work Here its Line.  ;)
IncCash( plr, mon.tointeger() );
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].