Pickup opposite me - 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: Pickup opposite me (
/showthread.php?tid=172735)
Pickup opposite me -
IceTea15 - 31.08.2010
Hello
How can i make if i type on example: /pickup when spawn a pickup but not on my coords, a pickup opposite with me +2 my coords. GetPlayerFacingAngle? or how?
Re: Pickup opposite me -
Grim_ - 31.08.2010
I think you're looking for this function.
pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{ // Created by ******
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid)) {
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
Re: Pickup opposite me -
Voldemort - 31.08.2010
/pickup
GetPlayerPos
CreatePickup(x+2
Re: Pickup opposite me -
[XST]O_x - 31.08.2010
pawn Код:
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
x += (2 * floatsin(-a,degrees));
y += (2 * floatsin(-a,degrees));
CreatePickup(modelid,x,y,z ....
Re: Pickup opposite me -
IceTea15 - 31.08.2010
thank you
good