Jump to content

whats the right word?


zombienation

Recommended Posts

hmm i cant get it to work :S 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
--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
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?

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 by Guest
Link to comment
--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

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...