Raised This Month: $ Target: $400
 0% 

Solved How to do: Givemoney no say


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 02-03-2020 , 15:09   How to do: Givemoney no say
Reply With Quote #1

I am writing a reward system. I want to give money according to the rank of the player. But I don't want this to appear in "chat".

The code I use is this:

Code:
server_cmd("amx_givemoney #%d %s", id, money);
How can I do it, can you help me?

SOLVED:

Code:
//previous money
prevMoney = cs_get_user_money(id);
lastMoney  = prevMoney + get_pcvar_num(money);
cs_set_user_money(id, lastMoney);

Last edited by msbeden; 02-04-2020 at 00:45.
msbeden is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 02-03-2020 , 15:37   Re: How to do: Givemoney no say
Reply With Quote #2

https://www.amxmodx.org/api/amxmisc/show_activity This controls broadcast in some cases. If there is a client_print or a te_text someplace in the code then no it won't.
__________________
DJEarthQuake is offline
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 02-03-2020 , 15:51   Re: How to do: Givemoney no say
Reply With Quote #3

Quote:
Originally Posted by DJEarthQuake View Post
https://www.amxmodx.org/api/amxmisc/show_activity This controls broadcast in some cases. If there is a client_print or a te_text someplace in the code then no it won't.
I'm not using "client_print". "server_cmd" only.

Code:
server_cmd("amx_show_activity 0");
I have to write after that?

Last edited by msbeden; 02-03-2020 at 15:52.
msbeden is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-03-2020 , 16:53   Re: How to do: Givemoney no say
Reply With Quote #4

I assume you're using another plugin to give players money? If so, can u post the code here so we can take a look at it.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 02-03-2020 , 17:43   Re: How to do: Givemoney no say
Reply With Quote #5

Quote:
Originally Posted by msbeden View Post
I'm not using "client_print". "server_cmd" only.

Code:
server_cmd("amx_show_activity 0");
I have to write after that?
That works. Another option. Disable it on amxx.cfg. Here's a incomplete snip making this thing a piggy-back plugin to gag the money giving plugin (not recommended). Even if you have amx_show_activity 0 some of these plugins have a way of precaching it to 1 so when you really have 0 in amxx.cfg it makes it 1 again. Personal gravity did that to me when I maintained it and it was no fun. Seems like you are in the same boat.

Code:
new amx_show_activity_pcvar public plugin_precache(){ amx_show_activity_pcvar = get_cvar_pointer("amx_show_activity") } @FnSugarDaddy(id,money){ new cvar_value = get_pcvar_num(amx_show_activity_pcvar) if ( cvar_value != 0 ){    set_cvar_num("amx_show_activity", 0); //Real discreet. No guarantee per other plugin.    server_cmd("amx_givemoney #%d %s", id, money);    set_cvar_num("amx_show_activity", 1); //Assumes you want it on 1 usually.    } }

What plugin is giving the money? You can edit that one or use an example that gives money silently similar to what I have attached. Feel free to use the function for your reward system.
Attached Files
File Type: sma Get Plugin or Get Source (sugardaddy.sma - 92 views - 1.3 KB)
__________________

Last edited by DJEarthQuake; 02-03-2020 at 18:13. Reason: quotes per other post
DJEarthQuake is offline
msbeden
Member
Join Date: Jan 2020
Location: Turkey, Eskisehir
Old 02-03-2020 , 23:50   Re: How to do: Givemoney no say
Reply With Quote #6

I tried but it doesn't. Is there any other money making code?
msbeden is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 02-04-2020 , 02:22   Re: How to do: Givemoney no say
Reply With Quote #7

It gives money no messages. Tested. The plugin that broadcasts the messages is evidently still in memory. Glad you got it.
__________________

Last edited by DJEarthQuake; 02-04-2020 at 02:23.
DJEarthQuake is offline
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 23:46.


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