[DMC] Posted October 9, 2010 Share Posted October 9, 2010 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
dzek (varez) Posted October 9, 2010 Share Posted October 9, 2010 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
[DMC] Posted October 9, 2010 Author Share Posted October 9, 2010 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
dzek (varez) Posted October 9, 2010 Share Posted October 9, 2010 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
[DMC] Posted October 10, 2010 Author Share Posted October 10, 2010 ok ty varez, now when i do /boom player its destroying me instead of the targer Link to comment
50p Posted October 10, 2010 Share Posted October 10, 2010 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
[DMC] Posted October 10, 2010 Author Share Posted October 10, 2010 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 Link to comment
dzek (varez) Posted October 10, 2010 Share Posted October 10, 2010 oh, i didnt noticed this.. 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