SA-MP Forums Archive
Need help with ramp spawning - 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: Need help with ramp spawning (/showthread.php?tid=88864)



Need help with ramp spawning - chaosnz - 29.07.2009

Im trying to add the function to place a ramp infront of the player using "onplayercommandtext"
heres what i have.

Quote:

if(strcmp(cmdtext, "/putramp", true)==0){
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
CreateObject(1634, X+5, Y, Z, 0.0, 0.0, A);
return 1;
}

Now whats happening is the ramps are being placed, except that when their placed, depending on the angle of the player, they can differ positions.

Can anyone let me know how i can fix this? as im not that good at scripting yet. And cant seem to figure out how to fix it.


Re: Need help with ramp spawning - JadedJ - 29.07.2009

I encountered the same problem it can be fixed using trigonometric functions (floatsin, floatcos) check out the thread I started it's got answers you need.

http://forum.sa-mp.com/index.php?topic=111600.0

You will also need to set a timer to destroy the object afterward
Good luck keep me posted


Re: Need help with ramp spawning - NeRoSiS - 29.07.2009

http://forum.sa-mp.com/index.php?top...1429#msg671429

Made it ages ago, just use it, credits don't matter.