SA-MP Forums Archive
[Help]Wanted Level Not Load + Score - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help]Wanted Level Not Load + Score (/showthread.php?tid=555507)



[Help]Wanted Level Not Load + Score - astanalol - 08.01.2015

Hello Guys
im Use y_ini
My Problems im off
and my in Data
Quote:

Score = 2

and wanted
Quote:

Wanted = 6

When im Back To Join And Login After That i Dont Have The 2 Score And 6 Wanted Why
im in Server > im goto see in my data i see
Quote:

Score = 2

Quote:

Wanted = 6

why its not load ?
PHP код:
forward LoadUser_data(playerid,name[],value[]);
public 
LoadUser_data(playerid,name[],value[])
{
    
INI_Int("Score",PlayerInfo[playerid][pScore]);
    
INI_Int("Wanted",PlayerInfo[playerid][pWanted]);
    return 
1;

please help +rep


Re: [Help]Wanted Level Not Load + Score - SickAttack - 08.01.2015

You have to give the player score with the function on login. Your wanted level is saved in your variable.


Re: [Help]Wanted Level Not Load + Score - astanalol - 08.01.2015

Quote:

if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE" Type your password below to login.","Login","Quit");
}

no
ok now what i put ?


Re: [Help]Wanted Level Not Load + Score - astanalol - 08.01.2015

how to make it in login to load ?


Re: [Help]Wanted Level Not Load + Score - astanalol - 08.01.2015

where u ?


Re: [Help]Wanted Level Not Load + Score - nogh445 - 08.01.2015

You need to add these to your login dialog, once the player has correctly typed his password.
pawn Код:
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);



Re: [Help]Wanted Level Not Load + Score - astanalol - 08.01.2015

sorry i want know pKills
And pDeaths
how to get player death and kill ?

i rep u now dude


Re: [Help]Wanted Level Not Load + Score - astanalol - 08.01.2015

help


Re: [Help]Wanted Level Not Load + Score - ahmedkoki - 08.01.2015

Post your code OnPlayerConnect


Re: [Help]Wanted Level Not Load + Score - PowerPC603 - 08.01.2015

Just add the score and wanted functions inside your loading function like this.
Then they are automatically set when the data is loaded and you don't have code spread all over the place that actually belongs together.

pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Wanted",PlayerInfo[playerid][pWanted]);

    SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);

    return 1;
}