zombienation Posted January 14, 2012 Share Posted January 14, 2012 Hello, I'd like to know whats the right word to make cars explode. For example, mechanic have addevent ... "Fixcar", If possible i'd like to make a terrorist job where others can blow up your car, like when mechanic gets in a car and do the command, id like to do the opposite then mechanic. Thx Link to comment
Castillo Posted January 14, 2012 Share Posted January 14, 2012 I don't know such event "Fixcar", maybe you mean the function: fixVehicle? if so, then to blow up a vehicle use: blowVehicle Link to comment
codeluaeveryday Posted January 14, 2012 Share Posted January 14, 2012 I think he means. When a terrorist enters a vehicle they can do /blowupcar to blow the car. If your a mechanic you can do /fixcar. I think he uses teams! Link to comment
zombienation Posted January 14, 2012 Author Share Posted January 14, 2012 hmm i cant get it to work strange, cuz the original script is just this --MechanicFix function fixCar (player,command) skin = getPedSkin (player) if ( skin == 50 ) then local vehicle = getPedOccupiedVehicle(player) if (vehicle) then fixVehicle(vehicle) takePlayerMoney(player,100) end end end addCommandHandler("repair" , fixCar) addCommandHandler("rp" , fixCar) this is how i changed it now --terroristdestroy function blowVehicle (player,command) skin = getPedSkin (player) if ( skin == 96 ) then local vehicle = getPedOccupiedVehicle(player) if (vehicle) then destroyVehicle(vehicle) takePlayerMoney(player,100) end end end addCommandHandler("destroy" , blowVehicle) addCommandHandler("blow" , blowVehicle) Link to comment
Castillo Posted January 14, 2012 Share Posted January 14, 2012 --MechanicFix function fixCar (player,command) local skin = getElementModel (player) if ( skin == 50 ) then local vehicle = getPedOccupiedVehicle(player) if (vehicle) then fixVehicle(vehicle) takePlayerMoney(player,100) end end end addCommandHandler("repair" , fixCar) addCommandHandler("rp" , fixCar) --terroristdestroy function blow(player,command) local skin = getElementModel (player) if ( skin == 96 ) then local vehicle = getPedOccupiedVehicle(player) if (vehicle) then blowVehicle(vehicle) takePlayerMoney(player,100) end end end addCommandHandler("destroy" , blow) addCommandHandler("blow" , blow) Link to comment
Thelastride Posted January 14, 2012 Share Posted January 14, 2012 Next time put code in lua tag First code is correct.You need to be wearing skin id 50 then /rp will work in car Second is also correct with skin 96 but you really want to kill terrorist too as its blowing his own vehicle? Link to comment
zombienation Posted January 14, 2012 Author Share Posted January 14, 2012 (edited) Next time put code in lua tagFirst code is correct.You need to be wearing skin id 50 then /rp will work in car Second is also correct with skin 96 but you really want to kill terrorist too as its blowing his own vehicle? the script i showed of mechanic works, but the script i changed for terrorist dont, when i take the team pickup in game of terrorist, everything is normal, chat message that says u joined team, name in team at scoreboard, everything normal, but i cant get the destroying to work yes once it will work i'll add more then the ammount they earn with it so it compensate what they lose, terrorists mostly die with their act, will the car blow the moment u press the command or will it start fire first for a few seconds? then the terror can jump out and the driver might be to late to jump out cuz he dont know whats going on lol if it can be handy, here is the team script of mechanic and terrorist, i think i changed the stuff correctly, feel free to test mechanic1 = createPed(50,-2614, 1354, 7, 0) setElementHealth(mechanic1, 100) mechanicpickup = createPickup (-2614, 1354, 7, 3, 1275, 15000 ) function mechanicskinpickup ( thePlayer ) setPedSkin ( thePlayer, 50 ) setPlayerTeam ( thePlayer, teammechanic ) setElementData ( thePlayer, "zombie", false ) outputChatBox ( "* " .. getPlayerName(playerWhoUses) .. " joined mechanic team", getRootElement(), 255, 255, 0,false) end addEventHandler ( "onPickupUse", mechanicpickup, mechanicskinpickup ) mechanic2 = createPed(50,1985, 2046, 10.8, 0) mechanicpickup2 = createPickup (1985, 2046, 10.8, 3, 1275, 15000 ) addEventHandler ( "onPickupUse", mechanicpickup2, mechanicskinpickup ) --terrorists- teamterrorist = createTeam ( "terrorists", 255, 255, 0 ) terrorist1 = createPed(96,-1015.9838867188, -693.84259033203, 32.0078125, 0) setElementHealth(terrorist1, 100) terroristpickup = createPickup (-1015.9838867188, -693.84259033203, 32.0078125, 3, 1275, 15000 ) function terroristskinpickup ( thePlayer ) setPedSkin ( thePlayer, 96 ) setPlayerTeam ( thePlayer, teamterrorist ) setElementData ( thePlayer, "zombie", true ) end addEventHandler ( "onPickupUse", terroristpickup, terroristskinpickup ) addEventHandler ("onPickupUse", getRootElement(), function (playerWhoUses) if (source == terroristpickup) then setPlayerNametagText (playerWhoUses, "" .. getPlayerName (playerWhoUses)) setElementData (playerWhoUses, "job", "farm") outputChatBox ( "* " .. getPlayerName(playerWhoUses) .. " joined terrorist ", getRootElement(), 255, 255, 0,false) end end) Edited January 14, 2012 by Guest Link to comment
zombienation Posted January 14, 2012 Author Share Posted January 14, 2012 --MechanicFix function fixCar (player,command) local skin = getElementModel (player) if ( skin == 50 ) then local vehicle = getPedOccupiedVehicle(player) if (vehicle) then fixVehicle(vehicle) takePlayerMoney(player,100) end end end addCommandHandler("repair" , fixCar) addCommandHandler("rp" , fixCar) --terroristdestroy function blow(player,command) local skin = getElementModel (player) if ( skin == 96 ) then local vehicle = getPedOccupiedVehicle(player) if (vehicle) then blowVehicle(vehicle) takePlayerMoney(player,100) end end end addCommandHandler("destroy" , blow) addCommandHandler("blow" , blow) thanks solid, i hope this works i see what u changed now, is there a wiki page or some page somewhere with script commands like function this and that? it takes lots of time sometimes to figure out one right word lol thx man Link to comment
Castillo Posted January 14, 2012 Share Posted January 14, 2012 Of course there is, never heard of MTA wiki? https://wiki.multitheftauto.com/wiki/Cli ... _Functions https://wiki.multitheftauto.com/wiki/Cli ... ing_Events https://wiki.multitheftauto.com/wiki/Ser ... _Functions https://wiki.multitheftauto.com/wiki/Ser ... ing_Events Link to comment
zombienation Posted January 14, 2012 Author Share Posted January 14, 2012 Of course there is, never heard of MTA wiki?https://wiki.multitheftauto.com/wiki/Cli ... _Functions https://wiki.multitheftauto.com/wiki/Cli ... ing_Events https://wiki.multitheftauto.com/wiki/Ser ... _Functions https://wiki.multitheftauto.com/wiki/Ser ... ing_Events yes but i dont always know the right terms to search it either, thx for the links Link to comment
Thelastride Posted January 14, 2012 Share Posted January 14, 2012 yes but i dont always know the right terms to search it either, thx for the links Its not that hard.If you searching for fixVehicle Its vehicle function so you go in server function Vehicles then you find fixVehicle Link to comment
zombienation Posted January 14, 2012 Author Share Posted January 14, 2012 solid is it possible that it still wont work? well i go to terroristpickup, i go in car, i do /blow or /destroy but nothing happens i tried the mechanic team to just to be sure but that is still working, i dont understand Link to comment
Castillo Posted January 14, 2012 Share Posted January 14, 2012 I think is because these commands are already used by "admin" resource. I renamed "blow" to "blow2" and it worked. Link to comment
zombienation Posted January 14, 2012 Author Share Posted January 14, 2012 haha now it works nice !! thx man 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