SA-MP Forums Archive
Help with safezone text - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with safezone text (/showthread.php?tid=531153)



Help with safezone text - prooftzm - 11.08.2014

Hi all. I try to make a function like this: when player is safe zone, player recive a message with that.
pawn Код:
forward SafeZone(playerid);
public SafeZone(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 155,1642.0690,-2241.6035,13.4940))
    {
    SCM(playerid, -1, "You are in the safe zone. DON'T SHOT ANYBODY.");
    }
    return 1;
}
With this code the player is not reciving any message.
I have no ideea what i need to do


Re: Help with safezone text - Twizted - 11.08.2014

Because Range (the second parameter) must be a float. It didn't work because you typed an integer (155), not a float (https://sampwiki.blast.hk/wiki/Float). I changed the code, it's ready for use. But I suggest you use a timer or else the chat will be spammed with the message. You might want to change the range aswell, 155.0 seems a little too much.

pawn Код:
forward SafeZone(playerid);
public SafeZone(playerid)
{
    //IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
    if(IsPlayerInRangeOfPoint(playerid, 155.0 ,1642.0690,-2241.6035,13.4940))
    {
    SCM(playerid, -1, "You are in the safe zone. DON'T SHOT ANYBODY.");
    }
    return 1;
}



Re: Help with safezone text - prooftzm - 11.08.2014

I don't get it can you explain me? and the code is not working.


Re: Help with safezone text - prooftzm - 11.08.2014

Someone can give me a good code?


Re: Help with safezone text - Twizted - 11.08.2014

Where are you calling the function?


Re: Help with safezone text - prooftzm - 11.08.2014

Under ongamemodeint


Re: Help with safezone text - Twizted - 11.08.2014

Well it's obviously not going to work there. Put it under OnPlayerUpdate and create a timer, so the message isn't sent every second or less.


Re: Help with safezone text - prooftzm - 11.08.2014

i got it. thx