Check if the player spawned in the position -
0ne - 18.11.2010
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?
Re: Check if the player spawned in the position -
boelie - 18.11.2010
if isplayerinrangeofpoint under playerspawn maybe?
Re: Check if the player spawned in the position -
0ne - 18.11.2010
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.
Re: Check if the player spawned in the position -
blackwave - 18.11.2010
Код:
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
}
Re: Check if the player spawned in the position -
0ne - 18.11.2010
are u kidding me? Read the previous post I'm not going to check 75times if he is in that co-ordinates
Re: Check if the player spawned in the position -
Brian_Furious - 18.11.2010
Can you post a part of your spawn code??
Re: Check if the player spawned in the position -
Maxips2 - 18.11.2010
PLAYER_STATE_SPAWNED
Re: Check if the player spawned in the position -
blackwave - 18.11.2010
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
Re: Check if the player spawned in the position -
Mauzen - 18.11.2010
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.
Re: Check if the player spawned in the position -
0ne - 19.11.2010
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!