Jump to content

why wont my function load


Recommended Posts

i tryed the best i could and this is if a player spawns the vehicle it blows up

im am a very basic scripter and im still learning so bare with me

function onEnter (vehicle, seat, jacker) 
    if ( getElementModel(vehicle) == 436 ) then 
        if ( hasObjectPermissionTo(source, "function.kickPlayer")) then 
        else     
            killPed(source) 
            outputChatBox("You are not a staff", source, 255, 0, 0 ) 
            DestoryVehicle(vehicle) 
        end 
    end 
addEventHandler("onPlayerVehicleEnter", getRootElement(), onEnter ) 

i want it to destroy the vehicle but it wont dissepear and i know the blowVehicle works but destroy doesnt

Link to comment
  
vehicle = { [436]=true } 
addEventHandler('onVehicleEnter', root, 
function (thePlayer) 
    if (hasObjectPermissionTo(thePlayer, 'function.kickplayer')) then 
    if (vehicle[getElementModel(thePlayer)]) then 
    outputChatBox('Your Ok', source, 255, 255 , 0) 
    else 
    killPed(thePlayer) 
    outputChatBox("You are not a staff", source, 255, 0, 0 ) 
    destroyElement(vehicle) 
   end 
  end 
end 
) 

not sure if it's right .

Link to comment

function onEnter (vehicle, seat, jacker) 
    if ( getElementModel(vehicle) == 436 ) then 
        if ( hasObjectPermissionTo(source, "function.kickPlayer")) then 
        else     
            killPed(source) 
            outputChatBox("You are not a staff", source, 255, 0, 0 ) 
            destroyElement(vehicle) 
        end 
    end 
end 
addEventHandler("onPlayerVehicleEnter", getRootElement(), onEnter ) 
Link to comment

i dont know if this well work test it ,

addEventHandler('onVehicleEnter', root, 
function (uPlayer) 
    if(getElementModel(getPedOccupiedVehicle(uPlayer) == 436 )) then 
    outputChatBox('Your Ok', source, 0, 255, 0) 
    else 
    removePedFromVehicle(getPedOccupiedVehicle(uPlayer)) 
    outputChatBox("You are not a staff", source, 255, 0, 0 ) 
  end 
end 
) 

and is the script for Race ?

Link to comment

no for freeroam/drift server im having private cars but only staff can enter and it kills the other players and i know i can do it in the freeroam resource but i want more control

Edit: your right Mr.Pres[T]ege i want it to kill the player and destroy the vehicle

Edited by Guest
Link to comment

OK try this one when player etner the vehicle after 2 sec will die if it was not staff :

function onEnter (vehicle, seat, jacker) 
    if ( getElementModel(vehicle) == 436 ) then 
        if ( hasObjectPermissionTo(source, "function.kickPlayer")) then 
        else     
            killPed(source) 
            outputChatBox("You are not a staff", source, 255, 0, 0 ) 
            destroyElement(vehicle) 
        end 
    end 
end 
addEventHandler("onPlayerVehicleEnter", getRootElement(), onEnter ) 
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...