saving score help - 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: saving score help (
/showthread.php?tid=502656)
saving score help -
iThePunisher - 25.03.2014
so here i made a simple save cop score but there is a problem . it save's all the scores that player take, i mean and rob scores i just want to save the cop scores how can i do that ??
here is my code
pawn Код:
public OnPlayerConnect(playerid)
{
new pname[128];
new file[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), savefolder,pname);
if(!dini_Exists(file)) {
dini_Create(file);
dini_IntSet(file, "Copskill", 0);
SetPlayerScore(playerid, dini_Int(file, "Copskill"));
}
else {
SetPlayerScore(playerid, dini_Int(file, "Copskill"));
}
return 1;
}
Re: saving score help -
JoanB - 25.03.2014
Could you explain a little bit better. As i see it right now i can see that it's
Quote:
dini_IntSet(file, "Copskill", 0);
|
Maybe you should change the number to like
Quote:
public OnPlayerConnect(playerid)
{
new pname[128];
new file[128];
save file [THEFILE]
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), savefolder,pname);
if(!dini_Exists(file)) {
dini_Create(file);
dini_IntSet(file, "Copskill", 1);
SetPlayerScore(playerid, dini_Int(file, "Copskill"));
}
else {
SetPlayerScore(playerid, dini_Int(file, "Copskill"));
}
return 1;
}
|
Re: saving score help -
iThePunisher - 25.03.2014
no the problem is that i just want to make it to save just the cop scores not and rob scores etc..
how can i do that?