raulrobi Posted April 19, 2010 Posted April 19, 2010 I have makd a roll script function roll(player.comd) local roll = math random(1.6) if roll = 1 then u won blablabla if roll = 2 u lost blablabla if roll = 3 u r muted if roll = 4 u win blablabla addCommandHandler(("roll",roll) it doesent work.CAN ANYONE REPAIR IT PLS.
bober370 Posted April 19, 2010 Posted April 19, 2010 lol function roll(player.comd) local roll = math random(1.6) if roll = 1 then u won blablabla elseif roll = 2 then u lost blablabla elseif roll = 3 then u r muted elseif roll = 4 then u win blablabla end end addCommandHandler(("roll",roll)
dzek (varez) Posted April 19, 2010 Posted April 19, 2010 omg teach yourself how top script.. this doesnt make sense 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)!
Dark Dragon Posted April 19, 2010 Posted April 19, 2010 function roll(player,command) -- a comma between parameters not a decimal point local rand = math.random(1,6) -- math.random (with a decimal point and also a comma to separate the parameters of math.random) if rand == 1 then -- == instead of = when comparing -- do something elseif rand == 2 then -- do something else elseif rand == 3 then -- do something else elseif rand == 4 then -- do something else elseif rand == 5 then -- do something else else -- do something else end -- end for the if in line 4 end -- end of the function addCommandHandler("roll",roll) -- add the command handler Loads of fun for free! Also a lot of fun for free!
karlis Posted April 19, 2010 Posted April 19, 2010 (edited) function rolldice(player,comd) local roll = math.random(1,4) if roll == 1 then outputChatBox("u won blablabla") elseif roll == 2 then outputChatBox("u lost blablabla") elseif roll == 3 then setPlayerMuted(source,true); setTimer(setPlayerMuted,1,30000,player,false) elseif roll == 4 then outputChatBox("u win blablabla") end end addCommandHandler("roll",rolldice) Edited April 22, 2010 by Guest [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
50p Posted April 19, 2010 Posted April 19, 2010 function roll(player,comd) local roll = math.random(1,4) if roll == 1 then outputChatBox("u won blablabla") elseif roll == 2 then outputChatBox("u lost blablabla") elseif roll == 3 then setPlayerMuted(source,true); setTimer(function() setPlayerMuted(source,false) end,1,30000) elseif roll == 4 then outputChatBox("u win blablabla") end end addCommandHandler("roll",roll) I do not recommend calling variables the same names as functions. - 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 19, 2010 Posted April 19, 2010 forgot, now edited [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
raulrobi Posted April 20, 2010 Author Posted April 20, 2010 ah i rolled and in the console it says: Acces denied @ 'setPlayerMuted' - line : 5
karlis Posted April 20, 2010 Posted April 20, 2010 you need give acl admin rights to acl, find how to in wiki [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
COOKIE2 Posted April 21, 2010 Posted April 21, 2010 it doesnt work for me http://rapidshare.com/files/378590061/roll.zip.htm can someone look what i did wrong please
dzek (varez) Posted April 22, 2010 Posted April 22, 2010 you.. posted.. 400 bytes script.. on.. RAPIDSHARE? I'm sure, that nobody will care.. post your code on forums.. or use pastebin.com or something, but not RAPIDSHARE! 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)!
Castillo Posted April 22, 2010 Posted April 22, 2010 you.. posted.. 400 bytes script.. on.. RAPIDSHARE?I'm sure, that nobody will care.. post your code on forums.. or use pastebin.com or something, but not RAPIDSHARE! this is his code, addCommandHandler("roll",rolldice) function rolldice(player,comd) local roll = math.random(1,4) if roll == 1 then outputChatBox("u won") elseif roll == 2 then outputChatBox("u lost") elseif roll == 3 then setPlayerMuted(source,true); setTimer(function() setPlayerMuted(source,false) end,1,30000) elseif roll == 4 then outputChatBox("u win") end end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
dzek (varez) Posted April 22, 2010 Posted April 22, 2010 cookie2, when you are adding event/command handler, the handler function MUST be defined BEFORE adding handler.. in other words: if you copy ready script from here, don't change it if you don't know what are you doing 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)!
COOKIE2 Posted April 22, 2010 Posted April 22, 2010 this doesnt work (i open notepad and paste in it then i do save as then i type roll.lua) function roll(player,comd) local roll = math.random(1,4) if roll == 1 then outputChatBox("u won blablabla") elseif roll == 2 then outputChatBox("u lost blablabla") elseif roll == 3 then setPlayerMuted(source,true); setTimer(function() setPlayerMuted(source,false) end,1,30000) elseif roll == 4 then outputChatBox("u win blablabla") addCommandHandler("roll",roll) end end
dzek (varez) Posted April 22, 2010 Posted April 22, 2010 COOKIE FFS!! Use that damn [ LUA] tags! and now: go to the 4th post of this topic. copy and paste and NOTHING MORE. And it will be fine.. Every post you are just messing the script, i dont know why? Maybe you tell me? 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)!
Aibo Posted April 22, 2010 Posted April 22, 2010 it would be much easier for you if you'd have any idea about programming at all. this code is already a bit messy, you're just messing it up even more: addCommandHandler("roll", function(player,comd) local roll = math.random(1,4) if roll == 1 then outputChatBox("u won blablabla", player) -- no player was specified, message'd be shown to all elseif roll == 2 then outputChatBox("u lost blablabla", player) elseif roll == 3 then setPlayerMuted(player, true) -- as i recall, "source" is not passed by command handler, use "player", but i may be wrong setTimer(setPlayerMuted, 30000, 1, player, false) -- what's more, setTimer parameters were messed up, 30000 executions with 1ms interval. elseif roll == 4 then outputChatBox("u win blablabla", player) end end ) ?
dzek (varez) Posted April 22, 2010 Posted April 22, 2010 your tryings are worthless, xbost.. he will edit that script 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)!
raulrobi Posted April 24, 2010 Author Posted April 24, 2010 COOKIE2 STOP STEAHLING SCRIPTS AND SCRIPT IT ONE.NOOOOB
raulrobi Posted April 24, 2010 Author Posted April 24, 2010 and for win at line 4 is: if roll == 1 then outputChatBox("u won blablabla", player) givePlayerMoney((source)100)
Taalasmaa Posted April 24, 2010 Posted April 24, 2010 Seriously, somebody need to ban the COOKIE12... http://www.sincitygaming.net - The next generation of gaming! SinCity Gaming | UltiRace 24/7 - 188.165.199.162:22003 SinCity Gaming | Roleplay Gaming - Beta soon! SinCity Gaming | Zombie Mode + - 188.165.199.162:22005 Instead of using ip: 188.165.199.162 you can use: sincitygaming.net
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