27.01.2011, 05:47
Quote:
How do i make a system when player type /spawncar then it will not spawn at that time. It will spawn after 2 mins, after he typed it. How will i make that? BTW how will i make the car not spawn on his head?
|
You have several available methods to delay the vehicle spawning. The first is probably the easiest, and that is using a timer to call the function that spawns a vehicle (The SetTimerEx function calls a public function WITH parameters, so keep that in mind when making the function). The second is using gettime when the player types the command, and then checking the time the player spawned it against the current time. You would so this in a timer (ie: if you use SetTimer instead of SetTimerEx, and do a player loop) or OnPlayerUpdate (if you use this method you'll likely need to build a module to make sure your code doesnt execute every update).
As for your question regarding how to make a vehicle spawn around the player, you can increase the X or Y position by like 5, or you can use the trig functions to make it always spawn infront of the player (Look up floatsin/floatcos or GetXYInfrontOfPlayer).