Wanted doesn't save. -
Addons - 02.09.2013
Hi,
I've a problem with my little script. Wanted system doesn't save. I did (OnPLayerUpdate & Register):
Код:
format(var, 32, "WantedLevel=%d\n",WantedLevel[playerid]);fwrite(hFile, var);
and (OnPlayerLogin):
Код:
if( strcmp( key , "WantedLevel" , true ) == 0 ) { val = ini_GetValue( Data ); WantedLevel[playerid] = strval( val ); }
What the f*ck cause this problem? I'm desperate!
@ I'm romanin, excuse my too bad english.
Re: Wanted doesn't save. -
Addons - 02.09.2013
Nobody can help me?
Re: Wanted doesn't save. -
doreto - 02.09.2013
Where do you actully save it player data? because from showing you don't save anything.
Re: Wanted doesn't save. -
DanishHaq - 02.09.2013
Trebuie sa faci cu pWantedLevel, cand logare, da-i wanted lui daca are pe pWantedLevel, cum ai pLevel, pAdmin etc. etc., cu ala Wanted[playerid], nu salvare ca salvare doar pe playerid, daca eu am intrat dupa unul care a avut wanted, eu iau wanted lui, deci, nu e asa bun. Incerca cum am zis mai sus.
He's Romanian, so I wrote it in Romanian.. but to avoid the disputes, here's a translation:
You need to do it with pWantedLevel, when he logs in, give him wanted if he has wanted on pWantedLevel, just as you have pLevel, pAdmin etc. etc., with the Wanted[playerid], it doesn't save because it saves only on the playerid, if I came on the game after someone who had wanted, I'd get his wanted level, so, this is not a good method. Try what I told you above.
Re: Wanted doesn't save. -
Addons - 04.09.2013
After this change, must to give wanted with "PlayerInfo[playerid][pWantedLevel] += 1;" ?
Re: Wanted doesn't save. -
DanishHaq - 04.09.2013
Just do "+ 1", and use SetPlayerCriminal for the wanted stars. On OnPlayerDisconnect put SetPlayerCriminal(playerid, 0);
Re: Wanted doesn't save. -
Addons - 04.09.2013
Ok, but must to delete "WantedLevel[playerid]" and "WantedPoints[playerid]" ? Many servers have these functions.
Re: Wanted doesn't save. -
DanishHaq - 04.09.2013
Yes, they are old functions though. Replace them with pWanted and save those pWanted to the user files, like pAdmin, pLevel etc.
Re: Wanted doesn't save. -
Addons - 04.09.2013
I've saved WantedLevel[playerid] like pAdmin etc. Delete it?
PS: Give me an example how could give wanted stars.
PS2: SetPlayerCriminal include WantedLevel[playerid] & WantedPoints[playerid]. Are you sure that what you say is correct?