Score wont save
#1

When we finish a trucking mission and get +1 score, it wont save. It's not there anymore when i relogg. Anyone got an idea how to fix? And money. The money doesn't get saved.
Reply
#2

We need to see the code. That might help.
Reply
#3

Quote:
Originally Posted by Stigg
Посмотреть сообщение
We need to see the code. That might help.
What code?
Reply
#4

Your saving code! (code you use to scan players code and save it)
Reply
#5

Quote:
Originally Posted by [NOR]John
Посмотреть сообщение
What code?
Your mission code Or at least your saving function.
So we can see what the problem might be.
Reply
#6

I don't find it.
Reply
#7

OMFG!!! You cant find saving system in your GM?? Or you use someones other gamemode?
Reply
#8

Dude, I am new to pawno, why do you think I ask for help?
Reply
#9

Quote:
Originally Posted by [NOR]John
Посмотреть сообщение
I don't find it.
Your out of luck then.
Reply
#10

This means you dont even have saving system! Well, try this!

On top of script:
pawn Код:
#include <dini>
OnPlayerSpawn:
pawn Код:
new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(File,sizeof(File),"/YourFolder/Players/%s.txt",name);
    if(dini_Exists(File))
    {
        SetPlayerScore(playerid,dini_Int(File,"Score));
        GivePlayerMoney(playerid,dini_Int(File,"
Money"));
    }
    return 1;
}
OnPlayerUpdate:
pawn Код:
new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(File,sizeof(File),"/YourFolder/Players/%s.txt",name);
    if(dini_Exists(File))
    {
        dini_IntSet(File,"Score",GetPlayerScore(playerid));
        dini_IntSet(File,"Money",GetPlayerMoney(playerid));
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)