How would i go about making a car only usable by one person?
#1

Im making a dmv system and i was wondering how can i make a car that spawns when the player chooses to do there license only usable by that person?

Thanks Matt
Reply
#2

Here is the basic code


pawn Код:
new
     vUser[MAX_VEHICLES];

new vehicleid = CreateVehicle( modelid, x ,y ,z , col1, col2 ); // You create the car that the player will use
vUser[vehicleid] = playerid; // When the player is ready to take the test

if( vUser[vehicleid] == playerid ) { .... code } // under OnPlayerStateChange
else { RemovePlayerFromVehicle(playerid); }
Reply
#3

this code sets every car to be for that player.
Reply
#4

Код:
new DrivingTestVehicle=CreateVehicle( modelid, x ,y ,z , col1, col2 );// The Driver Test Vehicle

SetPVarInt(playerid,"DrivingTest",1);// For when the player is ready to take the test

if(vehicleid==DrivingTestVehicle&&GetPVarInt(playerid,"DrivingTest")==0)// For under OnPlayerEnterVehicle
{
RemovePlayerFromVehicle(playerid);
}
Reply
#5

after putting this in my pawn says pawn library has stopped working.

im i right in thinking SetPVarInt(playerid,"DrivingTest",1);// For when the player is ready to take the test
goes where my DMV code is?
Reply
#6

Im so confused can you give me a simple way of doing it because that way doesnt seem to work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)