Toffbrown Posted April 2, 2013 Posted April 2, 2013 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
X-SHADOW Posted April 2, 2013 Posted April 2, 2013 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 .
Toffbrown Posted April 2, 2013 Author Posted April 2, 2013 Thanks X-SHADOW but it kills the Staff Player and doesnt destroy the Car :L
iPrestege Posted April 2, 2013 Posted April 2, 2013 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 )
X-SHADOW Posted April 2, 2013 Posted April 2, 2013 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 ?
iPrestege Posted April 2, 2013 Posted April 2, 2013 He want to kill the player not remove it from the vehicle >!<;
Toffbrown Posted April 2, 2013 Author Posted April 2, 2013 (edited) 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 April 2, 2013 by Guest
iPrestege Posted April 2, 2013 Posted April 2, 2013 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 )
Toffbrown Posted April 2, 2013 Author Posted April 2, 2013 X-SHADOW,Mr.Pres[T]ege thank you very much for helping me Mr.Pres[T]ege's one was what i was trying to do and X-Shadow thanks to. it works perfect
X-SHADOW Posted April 2, 2013 Posted April 2, 2013 You'r welcome but what script worked with you mine or his ?
Toffbrown Posted April 3, 2013 Author Posted April 3, 2013 well they both worked but what X-Shadow wrote wasn't what i was mainly looking for but it was probably the way i explained my erro
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