Jump to content

DD/DM WIN


loler

Recommended Posts

Posted

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?

:glasses2::bazooka::bazooka::onfire::onfire::onfire::onfire::onfire:

M T A

Note:SAMP SUCKS BADLY!!!

Note: People in fire are SAMP

Posted

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

Posted
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

Posted
onPlayerWasted you could check how many players remain alive, if 1, then triggerEvent("onPlayerDestructionDerbyWin",winner,winner) (or the client-side equivalent).

Retired

Posted
function onDestructionDerbyWin()
triggerServerEvent("onDestructionDerbyWin", getLocalPlayer()) 
end

I maked one but it didnt works

:glasses2::bazooka::bazooka::onfire::onfire::onfire::onfire::onfire:

M T A

Note:SAMP SUCKS BADLY!!!

Note: People in fire are SAMP

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

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Nah , i dont know how to make the client :oops:

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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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)!

Posted
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

Posted

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)!

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