SA-MP Forums Archive
Adding car nos if player/vehicle pos is.. - 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: Adding car nos if player/vehicle pos is.. (/showthread.php?tid=249744)



Adding car nos if player/vehicle pos is.. - pliptm - 20.04.2011

Hello.
I tried to figure out, that how can i add nos to car when player/vehicle pos is 352.12,-1135.57,2190.69?

Nos component id is 1010
Can somebody help me?

EDIT: And when it's possible then add nos when pos is 352.12,-1135.57,2190.69 and range is about 10 or 5?


Re: Adding car nos if player/vehicle pos is.. - Ash. - 20.04.2011

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2.5, 352.12,-1135.57,2190.69))
{
     AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
I have used IsPlayerInRangeOfPoint because you will probably find it'll be very hard for a player to be in those exact coordinates


Re: Adding car nos if player/vehicle pos is.. - pliptm - 20.04.2011

yes, thank you!
I started to think same.


Re: Adding car nos if player/vehicle pos is.. - Ash. - 20.04.2011

No problem

Ugh, This forum requires that you wait 120 seconds between posts. Please try again in 91 seconds.


Re: Adding car nos if player/vehicle pos is.. - Cameltoe - 20.04.2011

Quote:
Originally Posted by pliptm
Посмотреть сообщение
yes, thank you!
I started to think same.
Use IsPlayerInRange, it can be found in the ul.inc include.

Otherwise the player's could be at any z-axis.


Re: Adding car nos if player/vehicle pos is.. - pliptm - 20.04.2011

EDIT: Already got it, but still big big thanks to you..