AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How could I get user money? (https://forums.alliedmods.net/showthread.php?t=41196)

Xum 07-10-2006 20:17

How could I get user money?
 
I want to see how much $ an user has, but i haven't found get_user_money. I think it's a very simple question, but i don't know the answer :cry:

Rolnaaba 07-10-2006 20:18

Re: How could I get user money?
 
Code:
cs_get_user_money(id)
make sure to
Code:
#include <cstrike>

Shurik3n 07-10-2006 20:29

Re: How could I get user money?
 
If you need help finding a function try using
http://www.amxmodx.org/funcwiki.php

Xum 07-10-2006 20:41

Re: How could I get user money?
 
lol, was so simple :D. Thx again Rolnaaba .

Rolnaaba 07-10-2006 20:42

Re: How could I get user money?
 
anytime

Xum 07-10-2006 21:09

Re: How could I get user money?
 
And how can i remove some moneys from an user?
Code:
public plugin_init() {     register_plugin("Test", "0.1", "Xum")     register_cvar("armor_cost", "12000")     register_clcmd("say /test","cmd_test") } public cmd_test { get_user_armor(id) + 75 cs_get_user_money(id) -= get_cvar_num("armor_cost") }


Another easy thing i don't know how to fix :(. Damn i'm a noob :((

Rolnaaba 07-10-2006 21:11

Re: How could I get user money?
 
to remove money:
Code:
cs_set_user_money(id,cs_get_user_money(id) - get_cvar_num("armor_cost"))

v3x 07-10-2006 21:43

Re: How could I get user money?
 
Code:
new money = cs_get_user_money(id) - get_cvar_num("armor_cost"); if(money < 1) {   // they can't afford it } else {   // they can afford it   cs_set_user_money(id , money , 1); // the last param. makes it flash if set to 1 }

XxAvalanchexX 07-10-2006 23:48

Re: How could I get user money?
 
Your code requires that a user have at least $1 over the price of an item to purchase it. If I have $100, why can't I buy an $100 item? ;)

Lord_Destros 07-11-2006 17:37

Re: How could I get user money?
 
ooooo rejected :D

EDIT: ZOMG ALL HAIL TEH GABEN KINGZORZ, THE GHW SITE SEEMS LIKE IT IS UP!!!!!!!!!!!!!!!!11111111111oneoneoneoneoneo ne.

REEDIT 10 seconds later: AHHHHHH, v3x, you gotta get our hopes up by changing your sig and keeping the website in giant sized font.


All times are GMT -4. The time now is 08:02.

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