Jump to content

Get rank in DD/DM


maarten123

Recommended Posts

hi, i have a question.

i wanna make a stats script and i wanna get the rank if your die

so i try this but isn't work :P

Lua:

function saveondie(rank,source) 
    outputChatBox(getPlayerName(source).." Rank: "..tostring(rank),getRootElement(),0,255,0) 
end 
addEventHandler("onPlayerWasted",getRootElement(),saveondie) 

Error

ERROR (filename).lua:2 : attempt to concatenate a boolean value 

greeting maarten123

Link to comment

sure, you can use onPlayerWasted, but .. this script is just totally wrong!

  
function saveondie(rank,source) -- [b]wtf is this? check arguments list: [url=https://wiki.multitheftauto.com/wiki/OnPlayerWasted]https://wiki.multitheftauto.com/wiki/OnPlayerWasted[/url] | also DONT EVEN THINK OF NAMING ANYTHING "source". source is internal variable, and you should only read it![/b] 
    outputChatBox(getPlayerName(source).." Rank: "..tostring(rank),getRootElement(),0,255,0) -- [b]and few totall randomness. where you got that rank? you never set it, well, you script do NOTHING[/b] 
end 
addEventHandler("onPlayerWasted",getRootElement(),saveondie) 
  

Link to comment
sure, you can use onPlayerWasted, but .. this script is just totally wrong!
  
function saveondie(rank,source) -- [b]wtf is this? check arguments list: [url=https://wiki.multitheftauto.com/wiki/OnPlayerWasted]https://wiki.multitheftauto.com/wiki/OnPlayerWasted[/url] | also DONT EVEN THINK OF NAMING ANYTHING "source". source is internal variable, and you should only read it![/b] 
    outputChatBox(getPlayerName(source).." Rank: "..tostring(rank),getRootElement(),0,255,0) -- [b]and few totall randomness. where you got that rank? you never set it, well, you script do NOTHING[/b] 
end 
addEventHandler("onPlayerWasted",getRootElement(),saveondie) 
  

Oh, yes your right sorry i'm not very smart with LUA

function saveondie(ammo, attacker, weapon, bodypart) 
    outputChatBox(getPlayerName(source).." Rank: "..tostring(rank),getRootElement(),0,255,0) -- If you're lost then there will be shown what your rank (first, second, etc.) for the test, later i wanna save it on account data 
end 
addEventHandler("onPlayerWasted",getRootElement(),saveondie) 

i hope this is better :)

oh yes what is nou de source?

Link to comment

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