kevin11 Posted May 4, 2010 Posted May 4, 2010 (edited) i tried it and it doesnt give error but when i do /roll nothing happens addCommandHandler("roll", function(player,comd) randomroll = math.random(1, 3000) lossorwin = math.random(1, 3) if lossorwin == 1 then givePlayerMoney(player, 3500) outputChatBox ( ' .. getPlayerName ( thePlayer ) .. ' roll and wins ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) elseif lossorwin == 2 then takePlayerMoney(player, 3252) outputChatBox ( ' .. getPlayerName ( thePlayer ) .. ' roll and losses ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) elseif lossorwin == 3 then setPlayerMuted(player, true) setTimer(setPlayerMuted, 30000, 1, player, false) end end ) Edited May 4, 2010 by Guest
robhol Posted May 4, 2010 Posted May 4, 2010 Look at the code again. You're messing up the strings in outputChatBox. And use debugscript. Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
eAi Posted May 4, 2010 Posted May 4, 2010 The fact that even the syntax highlighting in your code above is broken is a good sign you've done something wrong.
dzek (varez) Posted May 4, 2010 Posted May 4, 2010 look at the lines 8-10 .. its all red.. something MUST be wrong then happy finding 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)!
karlis Posted May 4, 2010 Posted May 4, 2010 addCommandHandler("roll", function(player,comd) randomroll = math.random(1, 3000) lossorwin = math.random(1, 3) if lossorwin == 1 then givePlayerMoney(player, 3500) outputChatBox ( getPlayerName ( thePlayer ) .. ' roll and wins ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) elseif lossorwin == 2 then takePlayerMoney(player, 3252) outputChatBox ( getPlayerName ( thePlayer ) .. ' roll and losses ' .. randomroll .. ' !', getRootElement(), 255, 255, 0) elseif lossorwin == 3 then setPlayerMuted(player, true) setTimer(setPlayerMuted, 30000, 1, player, false) end end ) [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
Recommended Posts