27.09.2011, 03:10
Alright, lads this all complies into one.
The amount of cash you log in with stays there until you log out, say for an example - you log out with -5,000 and you'll log back in with -5,000 and get up to the positives; $6,000.
You'll still not be able to buy from /shop and /bombshop due to the simple fact you logged in with -5,000.
If you log in with positive $5,000 and waste it all in /shop or /bombshop then you can keep buying stuff even whilst in the negative - when you log out you'll log back in with negative.
Is there anyway you can update the money stats whilst in-game automatically?
This is one of my cases from /shop (exact same to every other case)
This is what I have to write in my scriptfile - OnPlayerDisconnect.
I have this in my /stats
This is when loading up the data.
The amount of cash you log in with stays there until you log out, say for an example - you log out with -5,000 and you'll log back in with -5,000 and get up to the positives; $6,000.
You'll still not be able to buy from /shop and /bombshop due to the simple fact you logged in with -5,000.
If you log in with positive $5,000 and waste it all in /shop or /bombshop then you can keep buying stuff even whilst in the negative - when you log out you'll log back in with negative.
Is there anyway you can update the money stats whilst in-game automatically?
This is one of my cases from /shop (exact same to every other case)
pawn Код:
case 1:{
if(PlayerInfo[playerid][pCash] <= 1499)
{
SendClientMessage(playerid, GREY, "Shop: You need $1500!");
return 1;
}
else if(PlayerInfo[playerid][pCash] >= 1500)
GivePlayerWeapon(playerid, 31, 600);
GivePlayerMoney(playerid, -1500);
pawn Код:
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
pawn Код:
new cash = PlayerInfo[playerid][pCash];
pawn Код:
INI_Int("Cash",PlayerInfo[playerid][pCash]);