[HOW-TO?] Get a car id and save it, so it can be used in serveral callbacks.
#1

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?
Reply
#2

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
Reply
#3

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); ??
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)