Xwad Posted July 22, 2016 Posted July 22, 2016 why is my code not working?? tank = {[496]=true} skins = { [100]=true,[101]=true,[102]=true,[103]=true } function disableEnemyTankUsage ( player, seat, jacked ) if ( tank[getElementModel(source)] ) and ( not skins[getElementModel(player)] ) then cancelEvent() outputChatBox ( "Enemy vehicle!", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), disableEnemyTankUsage )
Walid Posted July 22, 2016 Posted July 22, 2016 Working fine: Make sure you are not wearing one of these skins : 100,101,102,103. Make sure you are trying to enter Blista Compact vehicle Id : 496. local tank = {[496]=true} local skins = { [100]=true,[101]=true,[102]=true,[103]=true } function disableEnemyTankUsage ( player, seat, jacked ) if ( tank[getElementModel(source)] ) and ( not skins[getElementModel(player)] ) then cancelEvent() outputChatBox ( "Enemy vehicle!", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), disableEnemyTankUsage ) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Walid Posted July 22, 2016 Posted July 22, 2016 thanks! np Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Xwad Posted July 24, 2016 Author Posted July 24, 2016 Hey i have one more question: I want to disable that players can demage other player who are in a vehicle. I made the script but its not working: function stopMinigunDamage ( attacker, weapon, bodypart ) outputChatBox("test", 255, 255, 255) if isPedInVehicle (localPlayer) then cancelEvent() end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage )
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