loler Posted June 4, 2010 Share Posted June 4, 2010 Hey , i found a dd/dm win but it didnt works addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function (winner) givePlayerMoney(winner, 700) outputChatBox(getPlayerName ( winner ) .. " has won $700 as last player alive",getRootElement(),0,255,0) end ) I dont know why it didnt works can anyone help me? Link to comment
Callum Posted June 4, 2010 Share Posted June 4, 2010 That event is not being triggered (I presume) so the function won't ever do anything. onPlayerWasted you could check how many players remain alive, if 1, then triggerEvent("onPlayerDestructionDerbyWin",winner,winner) (or the client-side equivalent). Link to comment
NotAvailable Posted June 4, 2010 Share Posted June 4, 2010 Hey , i found a dd/dm win but it didnt works addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function (winner) givePlayerMoney(winner, 700) outputChatBox(getPlayerName ( winner ) .. " has won $700 as last player alive",getRootElement(),0,255,0) end ) I dont know why it didnt works can anyone help me? add this line on the top: AddEventOnClientTriggered I THINK Link to comment
Dark Dragon Posted June 4, 2010 Share Posted June 4, 2010 there simply is no such event unless you trigger it somewhere else. race won't Link to comment
Callum Posted June 4, 2010 Share Posted June 4, 2010 onPlayerWasted you could check how many players remain alive, if 1, then triggerEvent("onPlayerDestructionDerbyWin",winner,winner) (or the client-side equivalent). Link to comment
loler Posted June 5, 2010 Author Share Posted June 5, 2010 function onDestructionDerbyWin() triggerServerEvent("onDestructionDerbyWin", getLocalPlayer()) end I maked one but it didnt works Link to comment
Castillo Posted June 5, 2010 Share Posted June 5, 2010 addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function (winner) givePlayerMoney(winner, 1200) outputChatBox(getPlayerName ( winner ) .. " has won $1200 as last player alive",getRootElement(),0,255,0) end) Link to comment
The_Ex Posted June 5, 2010 Share Posted June 5, 2010 You don't know how to code/script and as far as i can see neither you pay some time to understand the code or learn from others. Start from the basics here: https://wiki.multitheftauto.com/wiki/Scr ... troduction You just ask for the solution... That's really WRONG. Link to comment
loler Posted June 5, 2010 Author Share Posted June 5, 2010 Nah , i dont know how to make the client Link to comment
Cannonball Posted June 5, 2010 Share Posted June 5, 2010 Isnt it obvious that he found this piece of code somewhere in his resourcecache folder? (Aka, another pirate?) Link to comment
Castillo Posted June 5, 2010 Share Posted June 5, 2010 Nah , i dont know how to make the client server.lua addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function (winner) givePlayerMoney(winner, 1200) outputChatBox(getPlayerName ( winner ) .. " has won $1200 as last player alive",getRootElement(),0,255,0) end) meta.xml <meta> <info author="Castillo" description="Price for winning a race" type="script" version="1.0" /> <script src="server.lua" type="server"/> meta> i guess u understand a litle more now Link to comment
dzek (varez) Posted June 5, 2010 Share Posted June 5, 2010 guyz, the problem is that his race resource doesnt trigger onPlayerDestructionDerbyWin at all.. afaik one of recent updates of race adds it, but im not sure Link to comment
Callum Posted June 5, 2010 Share Posted June 5, 2010 function check() local alive = getAlivePlayers() if (#alive == 1) then local player = alive[1] givePlayerMoney(player,1200) outputChatBox(getPlayerName(player).." has earned $1200 for being the last player alive",getRootElement(),0,255,0) end end addEventHandler("onVehicleExplode",getRootElement(),check) Something like that will work? I'm not sure if race uses peds or players. Link to comment
dzek (varez) Posted June 5, 2010 Share Posted June 5, 2010 afaik the only thing he need is to update race resource. if not: open destructionderby.lua from race resource and add: addEvent("onPlayerDestructionDerbyWin") on the first line and: -- under this line: showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) -- add this line: triggerEvent("onPlayerDestructionDerbyWin", getRootElement(), activePlayers[1]) Link to comment
loler Posted June 6, 2010 Author Share Posted June 6, 2010 Isnt it obvious that he found this piece of code somewhere in his resourcecache folder?(Aka, another pirate?) Nope, i found it on forum , here the link : https://forum.multitheftauto.com/viewtop ... 91&t=27487 And when i know good ONLY client sides can be found and what i need it is CLIENT side so 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