maarten123 Posted September 11, 2010 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
dzek (varez) Posted September 11, 2010 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.. 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)!
maarten123 Posted September 11, 2010 Author 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
maarten123 Posted September 11, 2010 Author 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
dzek (varez) Posted September 11, 2010 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) 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)!
maarten123 Posted September 11, 2010 Author 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?
dzek (varez) Posted September 12, 2010 Posted September 12, 2010 source is player that died (wiki page says it). its better, but rank is not existing 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)!
maarten123 Posted September 12, 2010 Author 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?
Wojak Posted September 12, 2010 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 create your teleports and interiors in MTA map editor want more excitment in your race map? - add a killer bot you may also add some peds (NPC) - CARMAGEDDON STYLE! 2paq MTA:SA Race Server
maarten123 Posted September 12, 2010 Author 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
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