01.02.2016, 17:11
Hello, so i'm making a vehicleowner ship and i'm almost done, but now I have to do car permissions like if a player is not the vehicle owner he can't enter the car.
So i've messed with it around at "OnPlayerEnterVehicle" and I can't get it to work. does any of you guys have an idea of how I can make it working like car permissions /givekeys etc... i'm not asking for the code just an idea of how to get it to work.
EDIT: I've made this code so far but it doesn't work, I can't even access my own vehicle or any vehicle at the server.
New variables
OnPlayerEnterVehicle:
So i've messed with it around at "OnPlayerEnterVehicle" and I can't get it to work. does any of you guys have an idea of how I can make it working like car permissions /givekeys etc... i'm not asking for the code just an idea of how to get it to work.
EDIT: I've made this code so far but it doesn't work, I can't even access my own vehicle or any vehicle at the server.
New variables
PHP код:
new VehicleOwner[MAX_VEHICLES] = {INVALID_PLAYER_ID, ...};
new VehicleOwner1[MAX_VEHICLES] = {INVALID_PLAYER_ID, ...};
new VehicleOwner2[MAX_VEHICLES] = {INVALID_PLAYER_ID, ...};
PHP код:
for(new x; x < MAX_VEHICLES; x++)
{
if(VehicleOwner[x] != playerid || VehicleOwner1[x] != playerid || VehicleOwner2[x] != playerid )
{
new tName[MAX_PLAYER_NAME], string[128], pID;
GetPlayerName(pID, tName, MAX_PLAYER_NAME);
format(string, sizeof(string), "This vehicle is owned by %s, you can't access it without hes permission", tName);
SendClientMessage(playerid, RED, string);
ClearAnimations(playerid);
break;
}
}