maarten123 Posted September 11, 2010 Share Posted September 11, 2010 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 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
dzek (varez) Posted September 11, 2010 Share Posted September 11, 2010 wtf? this is just random words. You are another guy that thinks if you put some random parts from wiki together - it will be working like you want o_O. Get back to Scripting tutorial - spend a week on trying to understand it all.. Link to comment
maarten123 Posted September 11, 2010 Author Share Posted September 11, 2010 wtf?this is just random words. You are another guy that thinks if you put some random parts from wiki together - it will be working like you want o_O. Get back to Scripting tutorial - spend a week on trying to understand it all.. sorry guy, but i try anything this is now the only one that i not understand Link to comment
maarten123 Posted September 11, 2010 Author Share Posted September 11, 2010 i see in wiki that you can you rank if you use the event: onPlayerFinish, but there is not a finish in DD/DM Link to comment
dzek (varez) Posted September 11, 2010 Share Posted September 11, 2010 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
maarten123 Posted September 11, 2010 Author Share Posted September 11, 2010 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
dzek (varez) Posted September 12, 2010 Share Posted September 12, 2010 source is player that died (wiki page says it). its better, but rank is not existing Link to comment
maarten123 Posted September 12, 2010 Author Share Posted September 12, 2010 source is player that died (wiki page says it).its better, but rank is not existing ok, but how can i get then the rank in DD/DM? Link to comment
Wojak Posted September 12, 2010 Share Posted September 12, 2010 i belive this rank shold be get by: rank = getElementData(source, "race rank") more info: https://wiki.multitheftauto.com/wiki/Resource:Race https://wiki.multitheftauto.com/wiki/Element_data Link to comment
maarten123 Posted September 12, 2010 Author Share Posted September 12, 2010 i belive this rank shold be get by: rank = getElementData(source, "race rank") more info: https://wiki.multitheftauto.com/wiki/Resource:Race https://wiki.multitheftauto.com/wiki/Element_data thanks , but i have a error on saving wait a sec 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