Jokeℝ1472771893 Posted October 3, 2012 Share Posted October 3, 2012 addEventHandler("onVehicleEnter",root,function(player,seat,jacked) if(player)and(seat==0)then acc = getAccountName(getPlayerAccount(player)) if(isObjectInACLGroup("user."..acc,aclGetGroup("Admin")))then setVehicleDamageProof(source,true) end end end) the script work perfect,but how to make it start by command and stop(make VehicleDamageProof False). Link to comment
scratcher911 Posted October 3, 2012 Share Posted October 3, 2012 function damageProof( player, command ) if (isPedInVehicle(player)) then acc = getAccountName(getPlayerAccount(player)) if(isObjectInACLGroup("user."..acc,aclGetGroup("Admin")))then setVehicleDamageProof( getPlayerOccupiedVehicle(player), not isVehicleDamageProof(getPlayerOccupiedVehicle(player)) end end end addCommandHandler("damageproof", damageProof) didn't test it! Link to comment
TAPL Posted October 3, 2012 Share Posted October 3, 2012 function damageProof( player, command ) if (isPedInVehicle(player)) then acc = getAccountName(getPlayerAccount(player)) if(isObjectInACLGroup("user."..acc,aclGetGroup("Admin")))then setVehicleDamageProof( getPlayerOccupiedVehicle(player), not isVehicleDamageProof(getPlayerOccupiedVehicle(player)) end end end addCommandHandler("damageproof", damageProof) didn't test it! You missed bracket at line 5. This better code. function damageProof(player) local vehicle = getPedOccupiedVehicle(player) if vehicle then local acc = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user."..acc, aclGetGroup("Admin")) then setVehicleDamageProof(vehicle, not isVehicleDamageProof(vehicle)) local ss = isVehicleDamageProof(vehicle) and "ON" or "OFF" outputChatBox("damageProof is now "..ss.." !", player, 255, 255, 255) end end end addCommandHandler("damageproof", damageProof) Link to comment
Jokeℝ1472771893 Posted October 3, 2012 Author Share Posted October 3, 2012 i will test it now. Thnx btw Edite:Thnx it's working perfect. Link to comment
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