`Dmz Posted April 1, 2010 Posted April 1, 2010 Hi community, I have a problem whit this scrip, when I push right arrow server outputs this one. [15:51:16] WARNING: rpg.server.lua: Bad argument @ 'getElementModel' - Line: 39 [15:51:16] ERROR: ...rver/mods/deathmatch/resources/RPG-FR/rpg.server.lua:40: attempt to perform arithmetic on local 'skin' (a boolean value) function whatEver ( ) bindKey ( source, "right", "down", function () local plSkin = getPedSkin(source) local plSkin = skin+1 setPedSkin(source,skin) end ) addEventHandler("onPlayerLogin", getRootElement(), whatEver)
karlis Posted April 1, 2010 Posted April 1, 2010 (edited) omg plSkin is not skin! function whatEver ( ) bindKey (source, "right", "down", function (player) local skin = getPedSkin(player) local skin = skin+1 setPedSkin(player,skin) end ) addEventHandler("onPlayerLogin", getRootElement(), whatEver) Edited April 1, 2010 by Guest [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
`Dmz Posted April 1, 2010 Author Posted April 1, 2010 omg plSkin is not skin! function whatEver ( ) bindKey ( source, "right", "down", function () local skin = getPedSkin(source) local skin = skin+1 setPedSkin(source,skin) end ) addEventHandler("onPlayerLogin", getRootElement(), whatEver) I've made this mistake writing the post, sorry, but it doesn't work to.
karlis Posted April 1, 2010 Posted April 1, 2010 try now, edited ^ [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
Jason_Gregory Posted April 1, 2010 Posted April 1, 2010 function whatEver ( ) bindKey (source, "right", "down", function (player) local skin = getPedSkin(player) local skin = skin+1 while setPedSkin(player,skin) ~= false do skin=skin+1 if(skin > 290)then --Should be the Maximum Skinid skin = 0 end end end ) addEventHandler("onPlayerLogin", getRootElement(), whatEver) Contact me if you need a Website / Signature ↑ / Mapuploadsystem (HTML5, JS, PHP, ASP.NET, MySQL / Sybase)
karlis Posted April 1, 2010 Posted April 1, 2010 (edited) litle fix: function whatEver ( ) bindKey (source, "right", "down", function (player) local skin = getPedSkin(player)+1 while not setPedSkin(player,skin) do skin=skin+1 % 290 end end ) end addEventHandler("onPlayerLogin", getRootElement(), whatEver) also, if you didnt know: a % b = a - math.floor ( b / a ) * b this is much more compact than "if x>y then.."" Edited April 2, 2010 by Guest [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
50p Posted April 2, 2010 Posted April 2, 2010 You shouldn't declare the same variable twice. It's confusing for reader (including author). - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
karlis Posted April 2, 2010 Posted April 2, 2010 wut u mean? [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
50p Posted April 2, 2010 Posted April 2, 2010 wut u mean? local skin = 1; local skin = skin + 1; - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
karlis Posted April 2, 2010 Posted April 2, 2010 k alrdy fixed, btw i dont get why u use ";", it only spends size [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
dzek (varez) Posted April 2, 2010 Posted April 2, 2010 k alrdy fixed, btw i dont get why u use ";", it only spends size almost every programming language (i dont know every, but a lot) uses ";" .. probably he used to press ";" 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)!
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