03.02.2013, 23:04
Hello.
I have a one problem, that i can't figure it out. Tried any different ways for hours and still no results.
What I'm planning to do is a vehicle ownership, where 1 player owns a car and another player can't start the machine without the keys.
Well, I have ownership, but what I can't figure out, how to make like player can start their own machine only
This works like this right now:
If I don't have a car, and I'm trying to start someone else's vehicle, then I can't do it. Says: You don't have the keys.
If I have my own vehicle, I can start whoever's vehicle.
I have a one problem, that i can't figure it out. Tried any different ways for hours and still no results.
What I'm planning to do is a vehicle ownership, where 1 player owns a car and another player can't start the machine without the keys.
Well, I have ownership, but what I can't figure out, how to make like player can start their own machine only
pawn Код:
//function
getPlayerVID(playerid) {
new
x;
while(x < MAX_VEHICLES) {
if(playerVehicleVariables[x][pVehicleOwner] >= 1) {
if(playerVehicleVariables[x][pVehicleOwner] == playerVariables[playerid][pInternalID]) {
return x;
}
}
x++;
}
return 0;
}
//for starting machine
if(getPlayerVID(playerid) >= 1) {
allowed= 1;
} else {
allowed= 0;
}
If I don't have a car, and I'm trying to start someone else's vehicle, then I can't do it. Says: You don't have the keys.
If I have my own vehicle, I can start whoever's vehicle.