Sami_~> Posted July 7, 2017 Share Posted July 7, 2017 help! can anyone tell me how to block rino and some vehicle. please...... Link to comment
ahmed20137 Posted July 7, 2017 Share Posted July 7, 2017 ؟؟no such mod installed }deathmatch} 1 Link to comment
keymetaphore Posted July 7, 2017 Share Posted July 7, 2017 Check if the vehicle entering is a Rhino ( event handler onvehicleenter ), and if it is, cancelEvent() my keyboard ain't workin correctly. 1 Link to comment
Infinity# Posted July 8, 2017 Share Posted July 8, 2017 What do you mean how to block rhino and some vehicles? Here you go from what I understand.@sami2277 local blockedVehicles = {[432] = true} function blockEnterOnBlockedVehicles(player, seat, jacked) local model = getElementModel(source) if isElement(source) and getElementType(source) == "vehicle" and (model and blockedVehicles[model]) then if isElement(player) and getElementType(player) == "player" and seat == 0 then cancelEvent(true, "blockedvehicle") outputChatBox("You cannot enter blocked vehicles.", player, 255, 0, 0, false) end end end addEventHandler("onVehicleStartEnter", getRootElement(), blockEnterOnBlockedVehicles) This won't allow anyone to access the rhino as a driver. You may add more vehicles to the blockedVehicles list, you will need to add their vehicle ID like I did and set it to 'true' in order for it to work. You separate the list with commas. Link to comment
Sami_~> Posted July 8, 2017 Author Share Posted July 8, 2017 i want to block only rino Link to comment
koragg Posted July 8, 2017 Share Posted July 8, 2017 3 minutes ago, sami2277 said: i want to block only rino So use the code above. And we don't know what you mean by "block". Link to comment
Sami_~> Posted July 8, 2017 Author Share Posted July 8, 2017 i mean no players should rino.. Link to comment
Infinity# Posted July 8, 2017 Share Posted July 8, 2017 Then use this code to block rhino. No one would be able to use the rhino on your server. local blockedVehicles = {[432] = true} function blockEnterOnBlockedVehicles(player, seat, jacked) local model = getElementModel(source) if isElement(source) and getElementType(source) == "vehicle" and (model and blockedVehicles[model]) then if isElement(player) and getElementType(player) == "player" and seat == 0 then cancelEvent(true, "blockedvehicle") outputChatBox("You cannot enter blocked vehicles.", player, 255, 0, 0, false) end end end addEventHandler("onVehicleStartEnter", getRootElement(), blockEnterOnBlockedVehicles) 1 Link to comment
Sami_~> Posted July 9, 2017 Author Share Posted July 9, 2017 thanks it work bu i also want to block mini gun weapon Link to comment
SkiZo Posted July 9, 2017 Share Posted July 9, 2017 (edited) 55 minutes ago, sami2277 said: thanks it work bu i also want to block mini gun weapon function forbeed( _,aMyWeapon ) if ( aMyWeapon == 38 ) then toggleControl( source,'fire',false ) outputChatBox ("#FF0000You Cannot Use This Weapon!",source, 255, 255, 255, true ) else toggleControl( source,'fire',true ) end end addEventHandler( "onPlayerWeaponSwitch",root,forbeed) Try This . We Don't give ready scripts !! you should post a script and we edit it ... Edited July 9, 2017 by Legend<3 1 1 Link to comment
SkiZo Posted July 9, 2017 Share Posted July 9, 2017 Just now, sami2277 said: Thanks it works..... No Problem Link to comment
Sami_~> Posted July 9, 2017 Author Share Posted July 9, 2017 legent i make this script for rocket launcher weapon id is 35 but it is not block. gea me a script to block rocket launcher Link to comment
SkiZo Posted July 9, 2017 Share Posted July 9, 2017 40 minutes ago, sami2277 said: legent i make this script for rocket launcher weapon id is 35 but it is not block. gea me a script to block rocket launcher function forbeed( _,aMyWeapon ) if ( aMyWeapon == 38 or aMyWeapon == 35 ) then toggleControl( source,'fire',false ) outputChatBox ("#FF0000You Cannot Use This Weapon!",source, 255, 255, 255, true ) else toggleControl( source,'fire',true ) end end addEventHandler( "onPlayerWeaponSwitch",root,forbeed) Use This .. Link to comment
Sami_~> Posted July 10, 2017 Author Share Posted July 10, 2017 mini gun id 38 is working but weapon id 35 is not working Link to comment
Storm-Hanma Posted July 10, 2017 Share Posted July 10, 2017 Edit freeroam folder find weapons.lua +vehiles .lua edit both of them with notepadc++ remove the lines of id which u need to block For example u need to remove ak47 Look for ak47weapon id then remove this ak47line only and save it and re- start freeroam again now u can't see ak47 in ur server same for vehicles+weapons +skins ... I suggest to make a copy of weapons.lua+vehicles.lua before editing it so that when u want to add them again u need to just add those id lines again and save it and start it Link to comment
SkiZo Posted July 11, 2017 Share Posted July 11, 2017 (edited) 17 hours ago, Khadeer143 said: Edit freeroam folder find weapons.lua +vehiles .lua edit both of them with notepadc++ remove the lines of id which u need to block For example u need to remove ak47 Look for ak47weapon id then remove this ak47line only and save it and re- start freeroam again now u can't see ak47 in ur server same for vehicles+weapons +skins ... I suggest to make a copy of weapons.lua+vehicles.lua before editing it so that when u want to add them again u need to just add those id lines again and save it and start it is better if he need to remove ak .. search for line and add -- so the line skiped .. ( for no copy and that long .. idk x'D is just a suggestion ) function forbeed( _,aMyWeapon ) if ( aMyWeapon == 38 or aMyWeapon == 35 ) then toggleControl( source,'fire',false ) toggleControl( source,'aim_weapon',false ) outputChatBox ("#FF0000You Cannot Use This Weapon!",source, 255, 255, 255, true ) else toggleControl( source,'fire',true ) toggleControl( source,'aim_weapon',true ) end end addEventHandler( "onPlayerWeaponSwitch",root,forbeed) Use TESTED and WORK FINE .. just remove or remplace the old one ! @sami2277 Edited July 11, 2017 by Legend<3 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