How can i do this - 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: How can i do this (
/showthread.php?tid=197041)
How can i do this -
iTorran - 07.12.2010
Hello,
Im creating a gamemode for a friend and ive hit a problem,
I was wondering how i can detect if the player is within certain radius of a car?
I tried searching and i didnt find anything.
Re: How can i do this -
Sascha - 07.12.2010
do it like:
Код:
new range[MAX_PLAYERS] = -1;
for(new v=0; v<MAX_VEHICLES; v++){
new Float:x, Float:y, Float:z;
GetVehiclePos(v, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)){
range[playerid] = v;
}
}
}
you need to add what should happen yourself:P