Question !!! [ REP ++ ]
#2

Quote:
Originally Posted by buburuzu19
Посмотреть сообщение
I am wondering how to make a safe zone.. i am thinking to use IsPlayerInRangeOfPoint and OnplayerGiveDamage but where to add to check if player enters / or is in the range of point x,y,z,range ?
I also want to add a textdraw which says "SAFE ZONE" when player enters the range.
use IsPlayerInArea
pawn Код:
/**
*   IsPlayerInArea(...)
*   ------------------------------------------
*   @params: (Float) minx , maxx , miny , maxy
*   Usage: if(IsPlayerInArea(...))...
*   ------------------------------------------
*   This function returns 1 if said playerid
*   is inside the specified area.
*   Returns 0 if not.
*/

IsPlayerInArea(playerid,    Float:minx, Float:maxx, Float:miny, Float:maxy)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if (x > minx && x < maxx && y > miny && y < maxy) return 1;
    return 0;
}
this is how you gather the coordinates:
Код:
miny-----------------maxy
|			|
|			|
|			|
|			|
|			|
|			|
minx-----------------maxx
you could also use GangZoneCreate with the coordinates you gathered
to make it visible on the map, if you want to.
Note that if you only create it with GangZoneCreate, its only there but not visible as said in the wiki.
Use GangZoneShowForAll/Player afterwards.


asfor the textdraws, i suggest you create them using Zamaroht's Textdraw editor,
improved by Southclaw: "to include support for Player Textdraws".
i didn't find Zamaroht's original post on the forums (if it still exists)
but you can get the one i just mentioned here
Reply


Messages In This Thread
Question !!! [ REP ++ ] - by buburuzu19 - 09.12.2014, 06:37
Re: Question !!! [ REP ++ ] - by CutX - 09.12.2014, 07:17
Re: Question !!! [ REP ++ ] - by buburuzu19 - 09.12.2014, 08:00
Re: Question !!! [ REP ++ ] - by buburuzu19 - 09.12.2014, 08:05
Re: Question !!! [ REP ++ ] - by M4D - 09.12.2014, 10:15

Forum Jump:


Users browsing this thread: 2 Guest(s)