Raised This Month: $ Target: $400
 0% 

Moneymod for sven co-op


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
styno
Junior Member
Join Date: Oct 2005
Old 04-15-2006 , 23:32   Moneymod for sven co-op
Reply With Quote #1

yo, i wanted to have a money mod for Sven co-op so i started scripting but somthing isn't right....

if you say amx_money you should see:You have YOUR_MONEY_HERE $
Code:
#include <amxmodx> new moneyhave[]=500 public plugin_init()     {     register_plugin("Money Mod","1.00","StYn0!")     register_menucmd(register_menuid("Moneymod Menu"), 1023, "mh_Adminmoneymenu")     register_clcmd("amx_moneymenu", "md_showmoneyMenu", -1, " ")     register_concmd("amx_money", "showmoney", -1, "Show your money") } public showmoney(id)     {     client_print(0,print_chat,"You have %s $",moneyhave)     return PLUGIN_CONTINUE } //end of showmoney /* Menu Admin money menu */ public mh_Adminmoneymenu(id, key) {     new name[32], authid[16]     get_user_name(id, name, 31)     get_user_authid(id, authid, 16)     switch(key) {         //give to 1         case 0: {             client_cmd(id, "localAddmoney(id,100)")         }         //give to all         case 1: {             client_cmd(id, "amx_pbmenu")//not yet         }         //take from 1         case 2: {             client_cmd(id, "amx_pbmenu")//not yet         }             //take from all         case 3: {             client_cmd(id, "amx_pbmenu")//not yet         }     }     return PLUGIN_HANDLED } //end of menu public md_showmoneyMenu(id, level, cid) {     new menu[256]     format(menu, 255, "Moneymod Menu^n^n1. Give money to 1 player^n2. Give money to all players^n3. Take money from 1 player^n4. Take money from all players^n5. Exit")     show_menu(id, ((1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)), menu)     return PLUGIN_HANDLED } //---------------------------------------------------------------------------------------------- //This function is the ONLY way this plugin should add/subtract money to a player //There are checks to prevent overflowing //To take money away just send the function a negative (-) number public localAddmoney(id, money) {     if (money > 0 && moneyhave[id] + money < moneyhave[id]) {         moneyhave[id] = 2147483647     }     else if (money < 0 && (moneyhave[id] + money < -1000000 || moneyhave[id] + money > moneyhave[id])) {         moneyhave[id] = -1000000     }     else {         moneyhave[id] += money     } } //end

cheers
__________________
Greetz,
StYn0
---
"Monkey see, monkey do :p"
styno is offline
 



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 05:04.


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