pawno question. code.
#1

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.
Reply
#2

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
Reply
#3

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?
Reply
#4

Xtreme mapper is the laziest way .
Reply
#5

https://sampwiki.blast.hk/wiki/SetPlayerWorldBounds - the lazy mans way
Reply
#6

Quote:
Originally Posted by Rav
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.
Reply
#7

Quote:
Originally Posted by backwardsman97
Maybe every 2500 seconds or so
I think you mean miliseconds.
Reply
#8

well i got the cords

SetPlayerWorldBounds(playerid, 513.8265, -233.5575, 2148.729, 1716.64;

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?
Reply
#9

Just reset their boundaries.
SetPlayerWorldBounds(playerid, 20000.0000,-20000.0000,20000.0000,-20000.0000);
Reply
#10

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)