iFerasMO Posted March 1, 2015 Share Posted March 1, 2015 Hello .. I've downloaded script prevents minigun + rhino but it fails only after remove the "else" was 100% in the host game but in my server does not work added to group Admin function onEnter (vehicle, seat, jacker) if ( getElementModel(vehicle) == 432 ) then if ( hasObjectPermissionTo(source, "function.kickPlayer")) then else killPed(source) outputChatBox("NO RHINO", source, 255, 0, 0 ) destroyElement(vehicle) end end end addEventHandler("onPlayerVehicleEnter", getRootElement(), onEnter ) function onSwitchToMinigun (previous, current) if ( current == 38 ) then if ( hasObjectPermissionTo(source, "function.kickPlayer")) then else killPed(source) outputChatBox("NO MINIGUN", source, 255, 0, 0 ) end end end addEventHandler("onPlayerWeaponSwitch", getRootElement(), onSwitchToMinigun ) Note: This is the problem I faced in a number of resources with Server Side. .. sorry for bad english Link to comment
roaddog Posted March 1, 2015 Share Posted March 1, 2015 function onEnter (vehicle, seat, jacker) if ( getElementModel(vehicle) == 432 ) then if ( not hasObjectPermissionTo(source, "function.kickPlayer")) then killPed(source) outputChatBox("NO RHINO", source, 255, 0, 0 ) destroyElement(vehicle) end end end addEventHandler("onPlayerVehicleEnter", getRootElement(), onEnter ) function onSwitchToMinigun (previous, current) if ( current == 38 ) then if ( not hasObjectPermissionTo(source, "function.kickPlayer")) then killPed(source) outputChatBox("NO MINIGUN", source, 255, 0, 0 ) end end end addEventHandler("onPlayerWeaponSwitch", getRootElement(), onSwitchToMinigun ) Try this, instead of using else, you could just add "not" logical paramenter at if statement. Link to comment
roaddog Posted March 1, 2015 Share Posted March 1, 2015 I have tested and it's worked, make sure you dont have a rights to kick player or make ur self as everyone or something. otherwise you will not see it. Link to comment
Enargy, Posted March 1, 2015 Share Posted March 1, 2015 function onEnter (vehicle, seat, jacker) if ( getElementModel(vehicle) == 432 ) then if ( not hasObjectPermissionTo(source, "function.kickPlayer")) then killPed(source) outputChatBox("NO RHINO", source, 255, 0, 0 ) destroyElement(vehicle) end end end addEventHandler("onPlayerVehicleEnter", getRootElement(), onEnter ) function onSwitchToMinigun (previous, current) if ( current == 38 ) then if ( not hasObjectPermissionTo(source, "function.kickPlayer")) then killPed(source) outputChatBox("NO MINIGUN", source, 255, 0, 0 ) end end end addEventHandler("onPlayerWeaponSwitch", getRootElement(), onSwitchToMinigun ) Try this, instead of using else, you could just add "not" logical paramenter at if statement. Not Working the code works perfectly. are you sure that the script is serverside? check meta file 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