PDA

View Full Version : Stats don't save..


Helpergood
18/07/2013, 09:03 PM
Hi guys.
I have had an error ..
It is that I can't save the score on my server.
Can anyone have a solution ? Thanks.
MORE NOTES:-
1.I use ladmin to set my score , but doesn't saved. [EDIT:Changed to LuxAdmin][SOLVED]
2.I need help to make that if someone kills the other , the killer gets +1 score and the killed gets -1 score.[SOLVED]

Thanks in advance .

RALL0
18/07/2013, 09:26 PM
To be honest I never heard of ladmin before, could you show us some codes?

Helpergood
18/07/2013, 09:28 PM
Dude..It is Lethal's Admin FS (http://forum.sa-mp.com/showthread.php?t=19819) ..
It is on the forums lol...

RALL0
18/07/2013, 09:32 PM
Well too bad I never heard of that FS, show the codes..
*EDIT:
A admin filterscript explains everything for itself, it has nothing to do with stats.

Helpergood
18/07/2013, 09:36 PM
But... since it does register/login players.. why won't it save score? "By the way I am sorry I meant score >.<"

Rufio
18/07/2013, 09:40 PM
2.I need help to make that if someone kills the other , the killer gets +1 score and the killed gets -1 score.


it is pretty simple though.


public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerScore(playerid, -1);
SetPlayerScore(killerid, +1);
return 1;
}

Helpergood
18/07/2013, 09:46 PM
it is pretty simple though.


public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerScore(playerid, -1);
SetPlayerScore(killerid, +1);
return 1;
}

Got the following errors / warnings


E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3200) : error 029: invalid expression, assumed zero
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3200) : warning 215: expression has no effect
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3200) : error 001: expected token: ";", but found ")"
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3200) : error 029: invalid expression, assumed zero
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3200) : fatal error 107: too many error messages on one line

Rufio
18/07/2013, 09:46 PM
and which is the 3200 th line ?

edit oh my bad. delete + lol

Helpergood
18/07/2013, 09:48 PM
and which is the 3200 th line ?
SetPlayerScore(killerid, +1);
BTW I have a warning that I used to get,so don't put it in mind lol.

Rufio
18/07/2013, 09:49 PM
I edited my post sorry again ^^ if it doesnt work just tell me ^^

RALL0
18/07/2013, 09:49 PM
If you're using YINI you can use something like this

//OnPlayerDisconnect
INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
//Under player successfully logged in
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);

Helpergood
18/07/2013, 09:51 PM
I edited my post sorry again ^^ if it doesnt work just tell me ^^
ah okay thanks didn't see that, it works now.
If you're using YINI you can use something like this

//OnPlayerDisconnect
INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
//Under player successfully logged in
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);


I am sorry.. But I don't know what am I using .. I am so beginner in scripting tho..I only map lol.


EDIT:Can you tell me how do I use that YINI?

RALL0
18/07/2013, 10:08 PM
Let me take a look at the filterscript, I'll keep you up to date.

Helpergood
18/07/2013, 10:11 PM
Let me take a look at the filterscript, I'll keep you up to date.

You mean my gamemode?

RALL0
18/07/2013, 10:15 PM
I see what caused it, they forgot to add this under onplayerdisconnect

dUserSetINT(PlayerName2(playerid)).("level",PlayerInfo[playerid][Level]);

Add that line under the similar lines and your problem is fixed.

Helpergood
18/07/2013, 10:18 PM
Got the following errors....

E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3172) : error 017: undefined symbol "dUserSetINT"
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3172) : error 029: invalid expression, assumed zero
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3172) : error 017: undefined symbol "PlayerInfo"
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3172) : fatal error 107: too many error messages on one line

Line 3172 is your line.. "dUserSetINT(PlayerName2(playerid)).("level",PlayerInfo[playerid][Level]);"

RALL0
18/07/2013, 10:20 PM
If you use the FS like you said you shouldn't get these errors :s can you show the entire OnPlayerDisconnect?

Rufio
18/07/2013, 10:23 PM
The prob is he wrote it to his gamemode. Lol. Open your filterscript and write it. Delete that line at gamemode. That should work.

Helpergood
18/07/2013, 10:23 PM
If you use the FS like you said you shouldn't get these errors :s can you show the entire OnPlayerDisconnect?

Sure thing,

public OnPlayerDisconnect(playerid, reason)
{
new PlayerName[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

if(AccInfo[playerid][LoggedIn] == 1)
SavePlayerStats(playerid);

if(udb_Exists(PlayerName2(playerid))) dUserSetINT(PlayerName2(playerid)).("Loggedin",0);
AccInfo[playerid][LoggedIn] = 0;
AccInfo[playerid][Level] = 0;
AccInfo[playerid][pVip] = 0;
AccInfo[playerid][Jailed] = 0;
AccInfo[playerid][pCaged] = 0;
AccInfo[playerid][MaxAdv] = 0;
AccInfo[playerid][Frozen] = 0;
AccInfo[playerid][Hide] = 0;
AccInfo[playerid][OnDuty] = 0;
AccInfo[playerid][pInvis] = 0;
AccInfo[playerid][pGps] = -1;

#if EnableTwoRcon == true
AccInfo[playerid][MaxRcon] = 0;
#endif

if(AccInfo[playerid][Jailed] == 1)
KillTimer( JailTimer[playerid] );

if(AccInfo[playerid][Frozen] == 1)
KillTimer( FreezeTimer[playerid] );

if(ServerInfo[Locked] == 1)
KillTimer( LockKickTimer[playerid] );

if(AccInfo[playerid][pCar] != -1) EraseVeh(AccInfo[playerid][pCar]);

Rufio
18/07/2013, 10:25 PM
Write AccInfo instead of PlayerInfo.

Helpergood
18/07/2013, 10:25 PM
The prob is he wrote it to his gamemode. Lol. Open your filterscript and write it. Delete that line at gamemode. That should work.

No, I did it on the LuxAdmin , but got those errors.. so I thought he meant I should put them to my gamemode... XD

Proof:-

E:\GTA SAMP\VSM Company\VSM GL\filterscripts\LuxAdmin.pwn(759) : error 017: undefined symbol "PlayerInfo"
E:\GTA SAMP\VSM Company\VSM GL\filterscripts\LuxAdmin.pwn(759) : warning 215: expression has no effect
E:\GTA SAMP\VSM Company\VSM GL\filterscripts\LuxAdmin.pwn(759) : error 001: expected token: ";", but found "]"
E:\GTA SAMP\VSM Company\VSM GL\filterscripts\LuxAdmin.pwn(759) : error 029: invalid expression, assumed zero
E:\GTA SAMP\VSM Company\VSM GL\filterscripts\LuxAdmin.pwn(759) : fatal error 107: too many error messages on one line

RALL0
18/07/2013, 10:26 PM
Woops, my bad I actually meant OnPlayerConnect. Truely sorry about that ;s

Helpergood
18/07/2013, 10:28 PM
Write AccInfo instead of PlayerInfo.

Ok this fixed it , thank you. :)

Rufio
18/07/2013, 10:31 PM
No problem :)

Helpergood
18/07/2013, 10:31 PM
@Rufio
Dude , what you gave me only sets it..
Like if I died one million times it will only set it back to -1 lol.
"Sorry if I didn't say what I meant lol, I meant this :-"
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerScore(playerid, -1);
SetPlayerScore(killerid, +1);
return 1;
}

Ugh Oh.. Something else..
Score didn't save!! :(

RALL0
18/07/2013, 10:36 PM
SetPlayerScore(playerid, -= 1);
SetPlayerScore(playerid, +=1);

Helpergood
18/07/2013, 10:39 PM
Errors again..
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3199) : error 029: invalid expression, assumed zero
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3199) : warning 215: expression has no effect
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3199) : error 001: expected token: ";", but found ")"
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3199) : error 029: invalid expression, assumed zero
E:\GTA SAMP\VSM Company\VSM GL\gamemodes\VSMGL.pwn(3199) : fatal error 107: too many error messages on one line


Line 3199:SetPlayerScore(playerid, -= 1);