Jump to content

Problem


[DMC]

Recommended Posts

Ty to varez i could make this

function findPlayerByName(playerPart) 
  local pl = getPlayerFromName(playerPart) 
  if isElement(pl) then 
    return pl 
  else 
    for i,v in ipairs (getElementsByType ("player")) do 
      if (string.find(getPlayerName(v),playerPart)) then 
        return v 
      end 
    end 
  end 
end 
  
function boomPlayer(playerSource, command, arg1, theVehicle) 
    local playerElement = findPlayerByName(arg1) 
    if playerElement then 
      local name = getPlayerName(playerElement) 
      local theVehicle = getPedOccupiedVehicle (playerSource) 
      local sourceName = getPlayerName(playerSource) 
      blowVehicle ( theVehicle ) 
      outputChatBox (""..getPlayerName(playerElement).."Has been destroyed by "..getPlayerName(playerSource).."!", getRootElement(), 0, 0, 5, true) 
    end 
end 
addCommandHandler("boom", boomPlayer) 
  

but its not working at all, and no errors

Link to comment

hmm, you have theVehicle argument in your boomPlayer and trying to overwrite it on line 18 - i dont know what happens in that situation.

also for outputChatBox just use:

outputChatBox (getPlayerName(playerElement).."Has been destroyed by "..getPlayerName(playerSource).."!", getRootElement(), 0, 0, 5, true) 

no need for that ""..

Link to comment

i dont really see what im overwriting but its still not working, i read what you say and no errors nothing ;S

and its not outputting it to the chatbox

function findPlayerByName(playerPart) 
  local pl = getPlayerFromName(playerPart) 
  if isElement(pl) then 
    return pl 
  else 
    for i,v in ipairs (getElementsByType ("player")) do 
      if (string.find(getPlayerName(v),playerPart)) then 
        return v 
      end 
    end 
  end 
end 
  
function boomPlayer(playerSource, command, arg1, theVehicle) 
    local playerElement = findPlayerByName(arg1) 
    if playerElement then 
      local name = getPlayerName(playerElement) 
      local theVehicle = getPedOccupiedVehicle (playerSource) 
      local sourceName = getPlayerName(playerElement) 
      blowVehicle ( theVehicle ) 
      outputChatBox (getPlayerName(playerElement).." Has been destroyed by "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 0, true) 
    end 
end 
addCommandHandler("boom", boomPlayer) 
  

Link to comment
function boomPlayer(playerSource, command, arg1, [b]theVehicle[/b]) 
    local playerElement = findPlayerByName(arg1) 
    if playerElement then 
      local name = getPlayerName(playerElement) 
      local [b]theVehicle[/b] = getPedOccupiedVehicle (playerSource) 
      local sourceName = getPlayerName(playerElement) 
      blowVehicle ( theVehicle ) 
      outputChatBox (getPlayerName(playerElement).." Has been destroyed by "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 0, true) 
    end 
end 

just remove that argument on line 14 in your script

Link to comment
function boomPlayer(playerSource, command, arg1, [b]theVehicle[/b]) 
    local playerElement = findPlayerByName(arg1) 
    if playerElement then 
      local name = getPlayerName(playerElement) 
      local [b]theVehicle[/b] = getPedOccupiedVehicle (player[b]Element[/b]) 
      local sourceName = getPlayerName(playerElement) 
      blowVehicle ( theVehicle ) 
      outputChatBox (getPlayerName(playerElement).." Has been destroyed by "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 0, true) 
    end 
end 

just remove that argument on line 14 in your script

Link to comment
function boomPlayer(playerSource, command, arg1, [b]theVehicle[/b]) 
    local playerElement = findPlayerByName(arg1) 
    if playerElement then 
      local name = getPlayerName(playerElement) 
      local [b]theVehicle[/b] = getPedOccupiedVehicle (player[b]Element[/b]) 
      local sourceName = getPlayerName(playerElement) 
      blowVehicle ( theVehicle ) 
      outputChatBox (getPlayerName(playerElement).." Has been destroyed by "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 0, true) 
    end 
end 

just remove that argument on line 14 in your script

OK :roll:

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