Raised This Month: $ Target: $400
 0% 

Assigning ID in stock.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-20-2016 , 05:10   Assigning ID in stock.
Reply With Quote #1

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(idarg1arg2) {



The code i currently have is this:
PHP Code:
stock RollTheDice(idpricevalue) {
    new 
dice random_num(16)
    new 
woncash dice value
    
new iCash cs_get_user_money(id)
    new 
payprice iCash price
    
    cs_set_user_money
(idpayprice)
    
cs_set_user_money(idiCash woncash)
    
    
ColorChat(idGREEN"[RTD]^1 You rolled a %i and won %i cash"dicewoncash)

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
__________________

Last edited by Napoleon_be; 05-20-2016 at 05:15.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode