Pickup Help!
#1

Hello!

I made a pickup thats supposed to restore the player's health to 100%, set their drunk level to 0, play a sound when the pickup is picked up, and subtract $250 from their money.

The problem I have is that if you walk through the pickup, the player's health gets set to 100, the sound plays, and $250 gets taken away from their balance. The drunk level doesn't reset back to 0. In order for it to reset back to 0, you must walk through the pickup 2 times.

Can anyone help me fix this problem please?!

http://pastebin.com/m7bc626ee
Reply
#2

BUMP!

Anyone?
Reply
#3

may i ask if that happens, when you pick it up if your health is >50 ?
Reply
#4

The drunk level gets set when the health is 50% or under.
Reply
#5

did u try a timer like 1000 ms instead of using OnPlayerUpdate?
maybe the problem is caused coz the OnPlayerUpdate gets called too often, while the script processes the pickup?
maybe its a return 1; missing in the Pickup script?
Reply
#6

I just quess, but how about SetPlayerDrunkLevel(playerid, 0.0);?
Reply
#7

Quote:
Originally Posted by Babul
did u try a timer like 1000 ms instead of using OnPlayerUpdate?
maybe the problem is caused coz the OnPlayerUpdate gets called too often, while the script processes the pickup?
maybe its a return 1; missing in the Pickup script?
I did, but then the message "Get to the hospital..." spams.

Quote:
Originally Posted by Jakku
I just quess, but how about SetPlayerDrunkLevel(playerid, 0.0);?
...If you looked, it already had that line.
Reply
#8

Anybody?!
Reply
#9

I know it's a dumb reply, but... :
pawn Код:
SetPlayerDrunkLevel(playerid, 0.0);
SetPlayerDrunkLevel(playerid, 0.0);
// why don't you use it twice xD
Reply
#10

Quote:
Originally Posted by SAWC™
I know it's a dumb reply, but... :
pawn Код:
SetPlayerDrunkLevel(playerid, 0.0);
SetPlayerDrunkLevel(playerid, 0.0);
// why don't you use it twice xD
Not dumb at all. I tried that before, and was told by another friend of mine to do that. It didn't work though
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)