Raised This Month: $12 Target: $400
 3% 

Money plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yRestrict
BANNED
Join Date: Apr 2019
Old 02-03-2020 , 10:03   Money plugin
Reply With Quote #1

Good Morning
I have a little problem
I'll try to explain it right so that everyone understands
I have a flag capture mod that still has some bugs


i have the mp_startmoney "3500" cvar
but the following problem is happening
when someone spends money he comes back with nothing
so someone can make a plugin when the player had less than 3500 it will always respawn with that value
yRestrict is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-03-2020 , 12:36   Re: Money plugin
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

new g_pcvar_index;

public 
plugin_init()
{
   
RegisterHam(Ham_Spawn"player""fw_player_spawned"1)
   
g_pcvar_index get_cvar_pointer("mp_startmoney");
}

public 
fw_player_spawned(id)
{
   if(!
is_user_alive(id)) return;
   new 
value get_pcvar_num(g_pcvar_index);
   if(
cs_get_user_money(id) < valuecs_set_user_money(idvalue);

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-03-2020 at 12:49.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
yRestrict
BANNED
Join Date: Apr 2019
Old 02-03-2020 , 13:46   Re: Money plugin
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

new g_pcvar_index;

public 
plugin_init()
{
   
RegisterHam(Ham_Spawn"player""fw_player_spawned"1)
   
g_pcvar_index get_cvar_pointer("mp_startmoney");
}

public 
fw_player_spawned(id)
{
   if(!
is_user_alive(id)) return;
   new 
value get_pcvar_num(g_pcvar_index);
   if(
cs_get_user_money(id) < valuecs_set_user_money(idvalue);

Thanks, it worked here
yRestrict is offline
Reply


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 15:39.


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