pawno question. code. -
XeoN_13 - 20.03.2009
does any one know how to make something that takes u back to a position if u try to go out of range of that area?
like an IsPlayerInArea or something so i can add hydras hunters etc.. for a war in area51 but if they try to take the hydras around lv or san andreas it will make the player go back or take the hydra hunter etc.. out? any one knows how to do this?
btw. sorry for my bad english , and ill be happy to hear some answers.
Re: pawno question. code. -
Backwardsman97 - 20.03.2009
Set a repeating timer. Maybe every 2500 seconds or so. They can't get very far in that amount of time. Then check if the players that are supposed to be in the hydra area are out of the area and move them.
pawn Код:
//At the top
new bool:InDM[MAX_PLAYERS];
forward CheckArea();
//OnGameModeInit
SetTimer("CheckArea",2500,1);
//When they enter the dm area
InDM[playerid] = true;//Set to false when they leave
public CheckArea()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(InDm[i])
{
if(!/*do your area check here with isplayerinarea*/)
{
//Set their position
}
}
}
return 1;
}
I hope you understand
Re: pawno question. code. -
XeoN_13 - 20.03.2009
thanks backwardsman97
i understand :P
damit. sorry, one more quick question.. i cant get the cords for the area thing.. u know how i can get them?
Re: pawno question. code. -
[HiC]TheKiller - 20.03.2009
Xtreme mapper is the laziest way
![Smiley](images/smilies/smile.png)
.
Re: pawno question. code. -
[RP]Rav - 20.03.2009
https://sampwiki.blast.hk/wiki/SetPlayerWorldBounds - the lazy mans way
Re: pawno question. code. -
Backwardsman97 - 20.03.2009
That's a function for setting world boundaries for a player. That doesn't help him get them at all. You can use the Xtreme mapper app. Just make sure the coords are in the right format.
Re: pawno question. code. -
Mikep - 20.03.2009
Quote:
Originally Posted by backwardsman97
Maybe every 2500 seconds or so
|
I think you mean miliseconds.
Re: pawno question. code. -
XeoN_13 - 21.03.2009
well i got the cords
SetPlayerWorldBounds(playerid, 513.8265, -233.5575, 2148.729, 1716.64
![Cool](images/smilies/cool.gif)
;
but i cant get it to go away once they get out it says world boundries. is there a way to just kill the person once they reach this cords? or something?
Re: pawno question. code. -
Backwardsman97 - 21.03.2009
Just reset their boundaries.
SetPlayerWorldBounds(playerid, 20000.0000,-20000.0000,20000.0000,-20000.0000);
Re: pawno question. code. -
XeoN_13 - 21.03.2009
ok good idea.. thanks alot for helping. this is what i should do
ok so when they type /war etc..
teleports them to area51 etc..
if they get out of boundries will get them back, w hen they die i should make OnPlayerDeath etc... SetPlayerWorldBounds(playerid, 20000.0000,-20000.0000,20000.0000,-20000.0000);
or i could do
/outofwar
SetPlayerWorldBounds(playerid, 20000.0000,-20000.0000,20000.0000,-20000.0000);
etc.. right?
edit: dint work.. is there a way to do like , if the player is in a hydra,hunter or tank to set worl boundries to SetPlayerWorldBounds(playerid, 583.8938, -338.6584, 2428.998, 1576.513);
and once there out of the car to reset the boundries?