Really important!! - 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)
+--- Thread: Really important!! (
/showthread.php?tid=487940)
Really important!! -
Rapeassboi - 15.01.2014
So i made a system where a player can drop my gun and then it creates it a bit forward from the player and he can pick it up too but he can only pick it up from where he dropped it i want him to go towards the gun and in that position he can pick it up but he can only pick it up when he is at the position where he created the gun
So if i created the object (gun) like this
pawn Код:
CreateObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1] - 0.5 * floatcos(-(ang + 90.0), degrees), dGunData[f][ObjPos][2]-1, 93.7, 120.0, ang + 60.0);
what do i then write on IsPlayerInRangeOfPoint?
Re: Really important!! -
Hansrutger - 15.01.2014
pawn Код:
If(IsPlayerInRangeOfPoint(playerid, 1.0, dGunData[f][ObjPos][0], dGunData[f][ObjPos][1] - 0.5 * floatcos(-(ang + 90.0), degrees), dGunData[f][ObjPos][2]-1))
I wouldn't personally have used 3-dimensional arrays for that but it's up to you man. :P
Re: Really important!! -
Rapeassboi - 15.01.2014
Didnt work :/
Re: Really important!! -
Hansrutger - 16.01.2014
Errors that you received? And show me the code as well of where you placed it.
Re: Really important!! -
Rapeassboi - 16.01.2014
No errors it just didnt work..
Re: Really important!! -
Danialdano - 16.01.2014
Weird
Re: Really important!! -
Rapeassboi - 16.01.2014
pawn Код:
for(new a = 0; a < MAX_OBJ; a++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, dGunData[a][ObjPos][0], dGunData[a][ObjPos][1] - 0.5 * floatcos(-(ang + 90.0), degrees), dGunData[a][ObjPos][2]-1))
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, CEL, "No weapon near you");
code
Re: Really important!! -
Rapeassboi - 17.01.2014
bumpp