Faw[Ful] Posted September 13, 2011 Share Posted September 13, 2011 This script blow the player car when the player exit the map limit : function killimit (player) if getLocalPlayer() == player then pvehicle = getPedOccupiedVehicle(player) x,y,z = getElementPosition( pvehicle ) if z > 800 or z < -800 or x > 4000 or x < -4000 or y > 4000 or y < -4000 then blowVehicle ( pvehicle ) end end end setTimer(killimit, 1000, 0) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), killimit) It d'ont work I try many things , but I cannot find the errors. Client side script Link to comment
Discord Moderators Zango Posted September 13, 2011 Discord Moderators Share Posted September 13, 2011 function killimit() pvehicle = getPedOccupiedVehicle(localPlayer) if not pvehicle then return end x,y,z = getElementPosition(pvehicle) if z > 800 or z < -800 or x > 4000 or x < -4000 or y > 4000 or y < -4000 then blowVehicle ( pvehicle ) end end setTimer(killimit, 1000, 0) I suppose this is what you want? You need to look up the functions and events you use. And what they pass as parameters. In a clientside script, localPlayer or getLocalPlayer() always returns the controlling player. Link to comment
Faw[Ful] Posted September 13, 2011 Author Share Posted September 13, 2011 thanks ! I jumped when the car exploded omg. 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