Make Car Spawn At Player Chords
#1

Hello I was wondering how can i make it so that if i type /Alpha it will spawn a car infront of me (anywhere in the map)
Reply
#2

Use GetPlayerPos & CreateVehicle using the positions gathered from GetPlayerPos.
Reply
#3

You also need to use sine and cosine to get a position in front of the player. There are lots of functions for this though.

pawn Код:
stock GetXYInDirectionOfPosition(Float:direction, &Float:x, &Float:y, Float:dist)
{
  x += (dist * floatsin(-direction, degrees));
  y += (dist * floatcos(-direction, degrees));
}
Just us the player's facing angle for direction. You can also look at the debug FS for reference.
Reply
#4

Quote:
Originally Posted by backwardsman97
You also need to use sine and cosine to get a position in front of the player. There are lots of functions for this though.

pawn Код:
stock GetXYInDirectionOfPosition(Float:direction, &Float:x, &Float:y, Float:dist)
{
  x += (dist * floatsin(-direction, degrees));
  y += (dist * floatcos(-direction, degrees));
}
Just us the player's facing angle for direction. You can also look at the debug FS for reference.
Ok can kinda understand I know(c++ ^^)
But Can u help to write the script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)