Hi,
How do i assign an ID to a player in a stock?
for example, you create a new function using:
PHP Code:
register_clcmd("say", "HandleSay")
PHP Code:
public HandleSay(id) {
}
How can i do the same thing in stock? Can i just assign it whenever i want?
PHP Code:
stock stockfunction(id, arg1, arg2) {
}
The code i currently have is this:
PHP Code:
stock RollTheDice(id, price, value) {
new dice = random_num(1, 6)
new woncash = dice * value
new iCash = cs_get_user_money(id)
new payprice = iCash - price
cs_set_user_money(id, payprice)
cs_set_user_money(id, iCash + woncash)
ColorChat(id, GREEN, "[RTD]^1 You rolled a %i and won %i cash", dice, woncash)
}
but it's not working properly...
What it should do: Take the price money from current cash and add the total won money.
What it actually does: Only adds the total won money
__________________