AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Money plugin (https://forums.alliedmods.net/showthread.php?t=321287)

yRestrict 02-03-2020 10:03

Money plugin
 
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

Natsheh 02-03-2020 12:36

Re: Money plugin
 
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);



yRestrict 02-03-2020 13:46

Re: Money plugin
 
Quote:

Originally Posted by Natsheh (Post 2682593)
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


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

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