Radiation zones?
#1

Hi guys , i'm in need of some help , i'm trying to make some radiation zones but when I compile it gives me lots of errors here's the script
Code:
new LoseHP[MAX_PLAYERS];

forward NegativeDown(playerid);

public OnPlayerUpdate(playerid) // 
{
    if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z))
    {
        LoseHP[playerid] = SetTimerEx("NegativeDown",1000,1,"i",playerid);
    }
    return 1;
}

public NegativeDown(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid, health);
    SetPlayerHealth(playerid, health - 1.5); //
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(LoseHP[playerid]);
return 1;
}
Here are the errors
Code:
 : error 017: undefined symbol "MAX_PLAYERS"
) : error 009: invalid array size (negative, zero or out of bounds)
 : warning 235: public function lacks forward declaration (symbol "OnPlayerUpdate")
 : error 017: undefined symbol "IsPlayerInRangeOfPoint"
 : error 017: undefined symbol "SetTimerEx"
 : error 017: undefined symbol "GetPlayerHealth"
 : error 017: undefined symbol "SetPlayerHealth"
 : warning 235: public function lacks forward declaration (symbol "OnPlayerDisconnect")
 : error 017: undefined symbol "KillTimer"
Could anybody help me?
Reply
#2

Bump.
Reply
#3

Bump
Reply
#4

Code:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
you need to fill in the range and coordinates of your radiation zone.

like:

Code:
IsPlayerInRangeOfPoint( playerid, 10.0, 69.000, 1337.000, 13.370 )
Reply
#5

Also, it doesn't seem to be a good idea to start a timer at OnPlayerUpdate.. since that callback is called about 30x each second for each player..
Reply
#6

I already did it lol just didn't post the cords , but the errors are still the same
Quote:
Originally Posted by Schneider
View Post
Also, it doesn't seem to be a good idea to start a timer at OnPlayerUpdate.. since that callback is called about 30x each second for each player..
What I should use?
Reply
#7

Have you included a_samp?
Reply
#8

Nope :/ that's all the code i've been trying to compile
Reply
#9

Well, you should at least #include <a_samp> since the basic functions are defined in that include.
Reply
#10

pawn Code:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z))
    {
        if(!GetPVarInt(playerid,"RadiationTimerWorking"))
        {
            LoseHP[playerid] = SetTimerEx("NegativeDown",1000,1,"i",playerid);
            SetPVarInt(playerid,"RadiationTimerWorking",1);
        }
    }
    else SetPVarInt(playerid,"RadiationTimerWorking",0);
    return 1;
}
This will prevent the timer from from bugging
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)