Check if the player spawned in the position
#1

I got 50spawn points, and I'd like to know if anyone can help me detect if player has spawned there? I tried to check it via loop but I can't figure out a way what to write after it, I checked my whole code hoping to find an example, I did find some, but it was just a script that detects if vehicle is occupied so that didn't help me, can anyone suggest something, a code example maybe?
Reply
#2

if isplayerinrangeofpoint under playerspawn maybe?
Reply
#3

nah that wouldn't be a good idea, the enemy players or the player can stand there all day.. and besides, checking 50times? + for another team 25.
Reply
#4

Код:
public OnPlayerSpawn(playerid)
{
  new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);
  if(x == number && y == number && z == number) return SendClientMessage(playerid, COLOUR, "Spawned at cassino"); // Number == position x, y and z
}
Reply
#5

are u kidding me? Read the previous post I'm not going to check 75times if he is in that co-ordinates
Reply
#6

Can you post a part of your spawn code??
Reply
#7

PLAYER_STATE_SPAWNED
Reply
#8

Quote:
Originally Posted by 0ne
Посмотреть сообщение
are u kidding me? Read the previous post I'm not going to check 75times if he is in that co-ordinates
Код:
Then you should define it all, put (if spawn1) return SendClientMEssage
Reply
#9

I can think of three different ways to set a players spawn position: 1. via CreateClass or 2. SetPlayerSpawnInfo or 3. with SetPlayerPos in OnPlayerSpawn

For the first one, just check the players skin id. If you are using SetPlayerSpawnInfo, set a playervariable to a specific value according to the spawn pos you set. Similar with SetPlayerPos: You will determine the players spawnpos in some way in OnPlayerSpawn, so set a variable for the player the same way.
Reply
#10

Uhh, thats not what i need .. I spawn the player with a Hunter helicopter and the problem is that other player can spawn IN HIM so i want the other player to get +20z co-ordinates this doesn't make any sense!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)