Jump to content

Script Not Working


iFerasMO

Recommended Posts

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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...