Saving Money
#1

Hello guys, i am trying to figure out something, whenever i give money ingame to myself, i just get it, and 2 secs after, its gone, its not staying in my pocket, means, its not saving, any ideas what should i do to fix this one? Cause i am really lost, i am not much experienced, still learning, but this is pain for me
Reply
#2

Are you saving the player data somewhere? Do any account gets created/register?
Reply
#3

Yea, everything works just fine, accounts gets saved, but when i put money on server to myself, its just gone after a sec..
Reply
#4

Do you have a function called 'SetPlayerCash' under OnPlayerSpawn callback?
Reply
#5

public OnPlayerSpawn(playerid)
{
SetRealMoney(playerid, ScriptMoney[playerid]);

thats it.
Reply
#6

Quote:
Originally Posted by Nix92
Посмотреть сообщение
public OnPlayerSpawn(playerid)
{
SetRealMoney(playerid, ScriptMoney[playerid]);

thats it.
Now search for 'SetRealMoney' function/stock in your whole script. Paste it over here!

Next time for pawn codes use [ pawn ] [ /pawn ] tags.
Reply
#7

pawn Код:
#include <dini>

public OnPlayerConnect(playerid)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,aname,sizeof(aname));
    if(dini_Exists("aname.ini"))
    {
        SendClientMessage(playerid,-1,"[x] Logue-se para carregar sua conta...");
    }
    else if(!dini_Exists("aname.ini"))
    {
        dini_Create("aname.ini");
        dini_IntSet("aname.ini", "Dinheiro", 0);
    }
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,aname,sizeof(aname));
    dini_IntSet("aname.ini","Dinheiro",GetPlayerMoney(playerid));
    return 1;
}
public OnPlayerSpawn(playerid)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,aname,sizeof(aname));
    GivePlayerMoney(playerid,dini_Int("aname.ini","Dinheiro"));
    return 1;
}
Код:
Meus Projetos
¤ GameModes ¤
Brasil City Virtual 0.3e ---- 40 % Completed »» Forum: BcvGames.forumbrasil.net »» Site: Gta Lokidoido »» Servidor: [0.3e] • Brasil City Virtual • [RPG v1.0] »» Equipe: Murilo / dPlaYer / Malakas / Bruno_. e Emerson_.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)