ViperZz Posted April 23, 2020 Posted April 23, 2020 Salut! Astăzi am decis să apelez la forum fiindcă aici pot găsi rezolvarea. Doresc și eu să mă ajute cineva cu un script pentru că anumite mașini să nu poată fi accesate de playeri normali, doar de admini. Dacă mă poate ajuta cnv îl rog să îmi dea mesaj. Mulțumesc!
Tekken Posted April 24, 2020 Posted April 24, 2020 Un script sincer n-am timp sa-l fac, insa te invit sa inverci, ai nevoie de Eventul : 'onPlayerVehicleEnter' Functii: isObjectInAclGroup Si daca te uiti pe wiki la isObjectInAclGroup ai un exemplu te poti Lua dupa el. Succes. Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
Felix5k Posted April 24, 2020 Posted April 24, 2020 OnVehicleStartEnter si mai ai nevoie de un if care il citeste daca e admin simplu Paid Developer BatGaming
Hydra Posted April 25, 2020 Posted April 25, 2020 function adminVehicle() local car = getPedOccupiedVehicle(source) local accName = getPlayerAccount(source) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) and (getElementModel(car) == 411) then outputChatBox("Acces allowed", source, 255, 255, 255, true) else if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) and (getElementModel(car) == 411) then return cancelEvent() end end addEventHandler("onVehicleStartEnter", getRootElement(), adminVehicle) Incearca asta Social Media: Discord: Gabriel45#6859 Instagram: https://www.instagram.com/_gabriel_455/ YouTube: Hydra45 (https://www.youtube.com/c/Hydra45/)
Hydra Posted April 26, 2020 Posted April 26, 2020 (edited) 12 hours ago, Hydra said: function adminVehicle() local car = getPedOccupiedVehicle(source) local accName = getPlayerAccount(source) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) and (getElementModel(car) == 411) then outputChatBox("Acces allowed", source, 255, 255, 255, true) else if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) and (getElementModel(car) == 411) then return cancelEvent() end end addEventHandler("onVehicleStartEnter", getRootElement(), adminVehicle) Incearca asta @ViperZz , modifica tot codu cu asta deoarece nu o sa iti mearga cu ,,source" function adminVehicle(thePlayer) local car = getPedOccupiedVehicle(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) and (getElementModel(car) == 411) then outputChatBox("Acces allowed", thePlayer, 255, 255, 255, true) else if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) and (getElementModel(car) == 411) then return cancelEvent() end end end addEventHandler("onVehicleStartEnter", getRootElement(), adminVehicle) Edited April 26, 2020 by Hydra Social Media: Discord: Gabriel45#6859 Instagram: https://www.instagram.com/_gabriel_455/ YouTube: Hydra45 (https://www.youtube.com/c/Hydra45/)
ViperZz Posted April 26, 2020 Author Posted April 26, 2020 Multumesc mult Functioneaza! Dar cum as putea edita sa mearga pe mai multe masini?
Tekken Posted April 26, 2020 Posted April 26, 2020 Cu placere local unallowedVeh = {422, 514, 674}; addEventHandler("onVehicleStartEnter", root, function(player) local model = getElementModel(source); for _,id in ipairs(unallowedVeh) do if (model == id) then if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then outputChatBox("You are not allowed to use this vehicle!", 255, 0, 0); cancelEvent(); end end end end); Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now