Cash don't save until Kick.
#1

Well, i have work a new GM from 0, and i have serious problem i use Y_INI
This is my GM: http://pastebin.com/AjeyBt9f

Problem:

1.- The player register(you recieve 5000$ on the start)
2 .- If you try to loggin whit the user account, and you press the "quit" button, the server Kick the player
3 .- Then if you going to see the Scriptfiles, the player file (.ini) has the line of the money on 0$ cash


Any explication, help me please! D: Thanks
Reply
#2

From your first thread,
Quote:
Originally Posted by zDevon
Посмотреть сообщение
First off, you have done you password success/failure dialogs yet - and you've never spawned the player anywhere. Just a note.
____________________________________________
Anyway, your problem persists in the method you're using to get the player's money. GetPlayerMoney (which is the function you're using under OnPlayerDisconnect, and writing to the player file) returns just that - the player's money. From the green hud in the top right. Problem is, you never properly used GivePlayerMoney, so that green cash counter remained at zero. Thus zero is what was written to your files.

Under OnDialogResponse, change
pawn Код:
INI_WriteInt(File,"Cash",GivePlayerMoney(playerid,5000));
to
pawn Код:
INI_WriteInt(File,"Cash",0);
and add
pawn Код:
GivePlayerMoney(playerid,5000);
underneath INI_Close(File);

Add this to OnPlayerSpawn,
pawn Код:
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
Almost sure that I didn't miss anything. Send me a PM if I did and we'll get it sorted out .
Reply
#3

ummm u need to loop a savestats everything under onplayerdisconnect u would need to loop a savestats there
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)