[help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) {
#1

So i am working on a command to see if a player is in a certian place, and then if it is do some commands. But it does it for every where, how could i make this work?
Quote:

new Float, Float:y, Float:z;
if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) {
SetPlayerInterior(playerid, 9);
GivePlayerWeapon(playerid, 45,1);
if(GetPlayerTeam(playerid) == 2) {
print ("A japanese has enterd ship");
}
}

Reply
#2

That would have to be EXACTLY the same place, which would be basically impossible to do. Use PlayertoPoint function instead.
Reply
#3

Quote:
Originally Posted by Swift_
That would have to be EXACTLY the same place, which would be basically impossible to do. Use PlayertoPoint function instead.
.. unless you add a pickup to the exactly same place.
Reply
#4

it is the exact same place...
SetSpawnInfo(playerid, 1,285,315.745086,984.969299,0,0,0,0,0,0);
Reply
#5

Anyways, I don't think it's possible to do == with a float, am I wrong? Try looking at floatstr function, I'm too lazy to atm.
Reply
#6

pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z)
if(x == 315.745086 && y == 984.969299 && z == 1958.919067) {
edit, nvm.. this is what u need

Reply
#7

Quote:
Originally Posted by BMUK
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z)
if(x == 315.745086 && y == 984.969299 && z == 1958.919067) {
edit, nvm.. this is what u need

Thank you that worked very well
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)