[HOW-TO?] Get a car id and save it, so it can be used in serveral callbacks. - 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: [HOW-TO?] Get a car id and save it, so it can be used in serveral callbacks. (
/showthread.php?tid=104627)
[HOW-TO?] Get a car id and save it, so it can be used in serveral callbacks. -
Mirkan - 25.10.2009
Hey SA-MP Community!
I'm trying to make an engine system, but a little bit more advanced than normals.
This is what I want to make : When somebody enters a car, he cant hear the sound of the engine. I made it, it just takes the player's position, sets his position to = his x position, his y position, and his z position -100 (So he cant see himself because he's underground)
and then takes the script his vehicleid position, and sets the camera position to that vehicle, so he can see the car.
I made that, but my problem is, that, when I wanna make the /engine [on] command, I cant GetPlayerVehicleID and put the player inside, because he isn't inside the car! so the script cant know the car's id in wich he was...
Can someone please help me?
Re: [HOW-TO?] Get a car id and save it, so it can be used in serveral callbacks. -
Peter_Corneile - 25.10.2009
Quote:
Originally Posted by Mirkan
Hey SA-MP Community!
I'm trying to make an engine system, but a little bit more advanced than normals.
This is what I want to make : When somebody enters a car, he cant hear the sound of the engine. I made it, it just takes the player's position, sets his position to = his x position, his y position, and his z position -100 (So he cant see himself because he's underground)
and then takes the script his vehicleid position, and sets the camera position to that vehicle, so he can see the car.
I made that, but my problem is, that, when I wanna make the /engine [on] command, I cant GetPlayerVehicleID and put the player inside, because he isn't inside the car! so the script cant know the car's id in wich he was...
Can someone please help me?
|
Car ids are the serial numbers of how the cars are placed under OnGameModeInIt
Re: [HOW-TO?] Get a car id and save it, so it can be used in serveral callbacks. -
Mirkan - 25.10.2009
Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
Quote:
Originally Posted by Mirkan
Hey SA-MP Community!
I'm trying to make an engine system, but a little bit more advanced than normals.
This is what I want to make : When somebody enters a car, he cant hear the sound of the engine. I made it, it just takes the player's position, sets his position to = his x position, his y position, and his z position -100 (So he cant see himself because he's underground)
and then takes the script his vehicleid position, and sets the camera position to that vehicle, so he can see the car.
I made that, but my problem is, that, when I wanna make the /engine [on] command, I cant GetPlayerVehicleID and put the player inside, because he isn't inside the car! so the script cant know the car's id in wich he was...
Can someone please help me?
|
Car ids are the serial numbers of how the cars are placed under OnGameModeInIt
|
??, so how can I put the player in the same car again?? Just PutPlayerInVehicle(playerid, vehicleid, 0); ??
Re: [HOW-TO?] Get a car id and save it, so it can be used in serveral callbacks. -
Peter_Corneile - 25.10.2009
Quote:
Originally Posted by Mirkan
Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
Quote:
Originally Posted by Mirkan
Hey SA-MP Community!
I'm trying to make an engine system, but a little bit more advanced than normals.
This is what I want to make : When somebody enters a car, he cant hear the sound of the engine. I made it, it just takes the player's position, sets his position to = his x position, his y position, and his z position -100 (So he cant see himself because he's underground)
and then takes the script his vehicleid position, and sets the camera position to that vehicle, so he can see the car.
I made that, but my problem is, that, when I wanna make the /engine [on] command, I cant GetPlayerVehicleID and put the player inside, because he isn't inside the car! so the script cant know the car's id in wich he was...
Can someone please help me?
|
Car ids are the serial numbers of how the cars are placed under OnGameModeInIt
|
??, so how can I put the player in the same car again?? Just PutPlayerInVehicle(playerid, vehicleid, 0); ??
|
Yes use PutPlayerInVehicle