loler Posted June 4, 2010 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? M T A Note:SAMP SUCKS BADLY!!! Note: People in fire are SAMP
Callum Posted June 4, 2010 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). Retired
NotAvailable Posted June 4, 2010 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
Dark Dragon Posted June 4, 2010 Posted June 4, 2010 there simply is no such event unless you trigger it somewhere else. race won't Loads of fun for free! Also a lot of fun for free!
loler Posted June 4, 2010 Author Posted June 4, 2010 So , how can i fix it? M T A Note:SAMP SUCKS BADLY!!! Note: People in fire are SAMP
Callum Posted June 4, 2010 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). Retired
loler Posted June 5, 2010 Author Posted June 5, 2010 function onDestructionDerbyWin() triggerServerEvent("onDestructionDerbyWin", getLocalPlayer()) end I maked one but it didnt works M T A Note:SAMP SUCKS BADLY!!! Note: People in fire are SAMP
Castillo Posted June 5, 2010 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) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
The_Ex Posted June 5, 2010 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. MTASA.LV - Latvian MTA Community
loler Posted June 5, 2010 Author Posted June 5, 2010 Nah , i dont know how to make the client M T A Note:SAMP SUCKS BADLY!!! Note: People in fire are SAMP
Cannonball Posted June 5, 2010 Posted June 5, 2010 Isnt it obvious that he found this piece of code somewhere in his resourcecache folder? (Aka, another pirate?)
Castillo Posted June 5, 2010 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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
dzek (varez) Posted June 5, 2010 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 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)!
Callum Posted June 5, 2010 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. Retired
dzek (varez) Posted June 5, 2010 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]) 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)!
[KoG]Rouche Posted June 6, 2010 Posted June 6, 2010 It's work now ? Owner of Killer of GTA (Old =KoG= Servers)
loler Posted June 6, 2010 Author 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 M T A Note:SAMP SUCKS BADLY!!! Note: People in fire are SAMP
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