Jump to content

Problem


[DMC]

Recommended Posts

Posted

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

logo_left.png
Posted

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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) 
  

logo_left.png
Posted
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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
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

Posted
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:

logo_left.png
Posted

oh, i didnt noticed this..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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