Raised This Month: $ Target: $400
 0% 

cs_set_user_money


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tomy91
Member
Join Date: Jun 2006
Location: Latvia
Old 01-10-2007 , 11:50   cs_set_user_money
Reply With Quote #1

Hello, i need a little help with cs_set_user_money! I took the swear_filter plugin and tried to add myself a part that, if user says badword, it removes 500 $ from user's money! I tried to add like this: cs_set_user_money(id, -500) it works, but it doesn't remove 500 $ but sets user money -500$... If user had 5050 $, and he types a badword, his money sets to -500$! I need a help, how is the correct script when it removs that 500$ not sets the amount!

Thanks and sorry for incorrect engllish!
__________________
tomy91 is offline
Send a message via Skype™ to tomy91
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 01-10-2007 , 11:52   Re: cs_set_user_money
Reply With Quote #2

cs_set_user_money(id, get_user_money(id) - 500))
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 01-10-2007 , 12:24   Re: cs_set_user_money
Reply With Quote #3

Quote:
Originally Posted by P34nut View Post
cs_set_user_money(id, get_user_money(id) - 500))
The correct usage is:

cs_set_user_money(id, (cs_get_user_money(id) - 500));
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
tomy91
Member
Join Date: Jun 2006
Location: Latvia
Old 01-10-2007 , 12:51   Re: cs_set_user_money
Reply With Quote #4

Works, but: if money is 800, when i type badfwors, it removes 500, but after that on my screen it shows 1300 but the money isnt so much, so i can't buy anything! I wanted to say that it removes the money, but i don't know why it count together my money + 500$! How to get that it shows money correctly, too?
__________________
tomy91 is offline
Send a message via Skype™ to tomy91
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-10-2007 , 16:50   Re: cs_set_user_money
Reply With Quote #5

Quote:
Originally Posted by MaximusBrood View Post
The correct usage is:
Code:
new setmoney = cs_get_user_money(id) - 500 cs_set_user_money(id, clamp(setmoney, 800, 16000))

Last edited by [ --<-@ ] Black Rose; 01-10-2007 at 17:00.
[ --<-@ ] Black Rose is offline
Old 08-08-2013, 19:52
lobopack23
This message has been deleted by lobopack23.
Reply



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 22:29.


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