Wanted doesn't save.
#1

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.
Reply
#2

Nobody can help me?
Reply
#3

Where do you actully save it player data? because from showing you don't save anything.
Reply
#4

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.
Reply
#5

After this change, must to give wanted with "PlayerInfo[playerid][pWantedLevel] += 1;" ?
Reply
#6

Just do "+ 1", and use SetPlayerCriminal for the wanted stars. On OnPlayerDisconnect put SetPlayerCriminal(playerid, 0);
Reply
#7

Ok, but must to delete "WantedLevel[playerid]" and "WantedPoints[playerid]" ? Many servers have these functions.
Reply
#8

Yes, they are old functions though. Replace them with pWanted and save those pWanted to the user files, like pAdmin, pLevel etc.
Reply
#9

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)