Jump to content

need help


COOKIE2

Recommended Posts

Posted

i need help at roll5-6 the rest is just for now

addCommandHandler("roll",

function(player,comd)

local roll = math.random(1,6)

if roll == 1 then outputChatBox("u won", 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", player)

elseif roll == 5 then givePlayerMoney(source,3500)

elseif roll == 6 then takePlayerMoney(source,4500)

end

end

)

Posted

Hmm, why not try this way?

addCommandHandler("roll",
function(player,comd)
local roll = math.random(1,6)
if roll == 1 then outputChatBox("u won", 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("You win!", player)
elseif roll == 5 then setPlayerMoney( source, +3500 ) --Add $3500 to the money you have.
elseif roll == 6 then setPlayerMoney( source, -4500 ) --Reduce $4500 from the money amount you have.
end
end
)

If this still doesn't work, try changing 5 and 6 to:

elseif roll == 5 then setPlayerMoney(player, +3500)
elseif roll== 6 then takePlayerMoney(player,  -4500)

The way to put codes is by:

[lua]inside it is code, then end it with "/" in front of "lua"

XX3 is gone. This is my new name. :3

Posted

Use takePlayerMoney and givePlayerMoney. They are there for a reason.

setPlayerMoney will set player's money; it will not add the amount you pass in 2nd parameter.

If you'll takePlayerMoney with negative value, you may see weird money behaviour (either going way too high or down too low).

@COOKIE2, LEARN LEARN LEARN... You don't have source in your function anywhere... You have player in function parameter list, why don't you use it, master-helper?

Posted

Ow, so using setPlayerMoney by adding or decreasing it cause bugs right?

So the:

function(player,comd)

is a function parameter (inside the bracket)? COOKIE doesn't have "source" on the parameter.

XX3 is gone. This is my new name. :3

Posted

why dont you stick with your previous topic?

why dont you put code in lua tags?

why dont you read comments in the code you're trying to edit?

i commented that code about "player" instead of "source", if you'd bother to pay any attention to that your code would work and save people here from another cookie topic.

addCommandHandler("roll",
function(player,comd)
local roll = math.random(1,6)
if roll == 1 then outputChatBox("u won", player)
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) 
elseif roll == 4 then outputChatBox("You win!", player)
elseif roll == 5 then 
givePlayerMoney(player, 3500) -- Add $3500 to the money you have.
outputChatBox("You won $3500!", player) -- it's a good practice to inform player what happend to his cash, you know
elseif roll == 6 then 
takePlayerMoney(player, 4500) -- Reduce $4500 from the money amount you have.
outputChatBox("You lost $4500!", player)
end
end
)

?

Posted
STOP STEAHLING.I REPORT U TO MODERATOR

Raulrobi.... He's allowed to use these scripts.. You've posted them for a public.. But COOKIE12 should learn something by himself.

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

Posted

taalasmaa i agree i made 2 scripts yesterday 1: shows serial and ip when someone logs in 2: stats , it saves ur wins/deaths/cash

Posted
cookie no you didnt make anything, you ripped it off wiki...

Fail :D

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

Posted (edited)

OMFG STAY ON THE FUCKING TOPIC I DONT WANNA ARGUE ABOUT NOTHING

where is a moderator if i need one

Edited by Guest
Posted
dont make me prove im right

and still complaining xD!

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

Posted
talasma are u arguing me?then you got it wrong, i said it to cookie

Wut?

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

Posted
nevermind

Oh, sorry i looked that COOKIE2 wrote that :) Sorry karlis.

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...