Raised This Month: $ Target: $400
 0% 

make vaules global?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bone
Member
Join Date: Mar 2005
Location: Under your bed
Old 04-20-2005 , 16:22   make vaules global?
Reply With Quote #1

I am trying make lottery thing in my rp plug in here is current code.

Code:
 ////////////////////////////////////////////////////////////////////  // Start Lottery  //////////////////////////////////////////////////////////////////  public cmd_startlotto(id,level,cid) {     if(!cmd_access(id,level,cid,2)) {         return PLUGIN_HANDLED;     }     // start lotto         new winningticket = random_num (0, 3)     new arg1[256];         new hudstring[256];             read_argv(1,arg1,255);                 new jackpot = str_to_num(arg1)         format(hudstring,255,"%s",lotterymsg);                 return PLUGIN_HANDLED;  }  ////////////////////////////////////////////////////////////////////  // Buy Lotto Ticket  //////////////////////////////////////////////////////////////////  public buyticket(id) {     /*if(!cmd_access(id,level,cid,1)) {     return PLUGIN_HANDLED;     }*/     new ticket = random_num(0,3)         if(haveticket = 1) { // if exceeds our array         client_print(id,print_chat,"* [Lotto] You already have lotto ticket, gotta make it fair^n");         return PLUGIN_HANDLED;     }         client_print(id,print_chat,"* [Lotto] You bought a lotto ticket^n");         return PLUGIN_HANDLED;  }  ////////////////////////////////////////////////////////////////////  // check Lotto Ticket  ////////////////////////////////////////////////////////////////// public checkticket(id) {     /*if(!cmd_access(id,level,cid,1)) {     return PLUGIN_HANDLED;     }*/             if(ticket != winningticket) { // if exceeds our array         client_print(id,print_chat,"* [Lotto] you did not win, try again next time!^n");         return PLUGIN_HANDLED;         }                 client_print(id,print_chat,"* [Lotto] YOU WON THE LOTTERY!!! CONGRATS!!!^n");         userwallet[id] += jackpot         return PLUGIN_HANDLED;  }

the thing is that like checkticket doesnt know bout jackpot which is in when u start loteery etc.. so is there was make variable global so that all commands and shit can use it.
__________________
the shirt covered her face, she screamed and clawed, so billy stomped on the bitch until he broke in her jaw.
Bone is offline
Send a message via MSN to Bone
 


Thread Tools
Display Modes

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 09:54.


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