Hallo Community,
Ich habe was für vio_lite umgeschrieben was mir jemand
für la geschrieben hat. Unzwar soll man mit einem bestimmten Rang
nur bestimmte Fahrzeuge fahren aber derzeit kann jeder mit
jedem Auto fahren und ich weiß nicht was das Problem ist.
Ich hoffe mir kann jemand helfen.
Lua
FraktionCars = {}
FraktionCars[3] = {}
FraktionCars[3][0] = {555}
FraktionCars[3][1] = {407}
FraktionCars[3][2] = {545,474}
FraktionCars[3][3] = {545,474,461,579,487}
FraktionCars[3][4] = {545,474,461,579,487,475}
FraktionCars[3][5] = {545,474,461,579,487,475}
addEventHandler('onVehicleStartEnter', root, function(player)
if(getElementData(source, 'FraktionCar'))then
local index = false;
local carFraktion = getElementData(source, 'Fraktion');
if(carFraktion ~= false and carFraktion ~= nil)then
local carTable = FraktionCars[carFraktion][getElementData(player, 'rang')];
if(#carTable > 0)then
for k, v in pairs(carTable) do
if(v == getElementModel(source))then
index = true;
end
end
if(index == false)then
cancelEvent();
outputChatBox("Du besitzt nicht den nötigen Rang!", player, 125, 0, 0);
end
end
end
end
end)
Alles anzeigen