SA-MP Forums Archive
[help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) { - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) { (/showthread.php?tid=84924)



[help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) { - Indi Corrozo - 04.07.2009

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");
}
}




Re: [help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) { - Grim_ - 04.07.2009

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


Re: [help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) { - woot - 04.07.2009

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.


Re: [help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) { - Indi Corrozo - 04.07.2009

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


Re: [help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) { - Grim_ - 04.07.2009

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.


Re: [help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) { - BMUK - 04.07.2009

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




Re: [help]if(GetPlayerPos(playerid, x, y, z) == 315.745086,984.969299,1958.919067) { - Indi Corrozo - 04.07.2009

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