WantedLevel Variable Changing..(?)
#1

I am trying to server-side my server systems like WantedLevel etc..
So i restricted my systems to variables only.
I have some functions:

WHAT HAPPENS

WHAT SHOULD HAPPEN
Your new wanted level is 3
You have now lost a wanted level..!
You have now lost a wanted level..!
You have not any wantedlevel now..!

EDIT: Solved .. had problem at another timer with reset of my variable.
Reply
#2

What I can understand is that you want to edit these texts (?)
Explain more what is the problem lol
Reply
#3

Quote:
Originally Posted by Ner0x96
Посмотреть сообщение
What I can understand is that you want to edit these texts (?)
Explain more what is the problem lol
The problem is that my variable in-script changes to 0.

What should happen:
If my player has 5 wanted level stars - LoseWanted Timer starts.
Every 5 seconds timer reduce one wanted level star until it reach 0 wanted level stars.

But now no matter how many wanted level stars it has it just reduce immediately stars to 0.
Reply
#4

At SendClientMessage add information about current fuction, please. It'll be easier to follow the script. (example "Lose Wanted was called. You have not any wantedlevel now...")
Could you upload a screenshot with /timestamp?
Reply
#5

May I ask you, why are you using Timer there?
Reply
#6

After "losewanted[playerid] = SetTimerEx("LoseWanted", 5000,1,"i",playerid);" executes (in all instances) kill the timer first.
Reply
#7

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
After "losewanted[playerid] = SetTimerEx("LoseWanted", 5000,1,"i",playerid);" executes (in all instances) kill the timer first.
KillTimer then execute it?
Reply
#8

Quote:
Originally Posted by vassilis
Посмотреть сообщение
KillTimer then execute it?
PHP код:
KillTimer(losewanted[playerid]);
losewanted[playerid] = SetTimerEx("LoseWanted"5000,1,"i",playerid); 
Timer IDs start at 1 and are never used twice. So it's totally safe, and it's most likely the most appropriate approach to prevent timers from calling the same function twice or more times (considering the time they were started at) for the same player.
Reply
#9

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
PHP код:
KillTimer(losewanted[playerid]);
losewanted[playerid] = SetTimerEx("LoseWanted"5000,1,"i",playerid); 
Timer IDs start at 1 and are never used twice. So it's totally safe, and it's most likely the most appropriate approach to prevent timers from calling the same function twice or more times (considering the time they were started at) for the same player.
Ok i changed this but still that's not the problem since my problem didn't get a solution yet..
My problem is that after some seconds my pinfo[playerid][Wantedlevel] variable is resetted to 0 even if it should be reduced to 5(if wanted level was 6) to 4(if wantedlevel was 5) etc..
Reply
#10

Quote:
Originally Posted by vassilis
Посмотреть сообщение
Ok i changed this but still that's not the problem since my problem didn't get a solution yet..
My problem is that after some seconds my pinfo[playerid][Wantedlevel] variable is resetted to 0 even if it should be reduced to 5(if wanted level was 6) to 4(if wantedlevel was 5) etc..
Debug.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)