Quote:
Originally Posted by CrazY.
You need to post the full code otherwise there's nothing we can do, you'll have to figure it out your own
If you are not experienced enough to solve the problem you should probably ask in suggestion/requests
|
Here is the full code :
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "[VIP] Money Start"
#define VERSION "0.1"
#define AUTHOR "Celena Luna"
new g_FirstRound, g_iLastRoundMoney[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w");
register_logevent("logevent_round_end", 2, "1=Round_End")
RegisterHam(Ham_Spawn, "player", "fw_Player_Spawn_Post", 1)
g_FirstRound = 1
}
public Event_TextMsg_Restart()
{
g_FirstRound = 1
}
public logevent_round_end()
{
g_FirstRound = 0
new iPlayers[32] , iNum , Player;
get_players( iPlayers , iNum , "h" );
for ( new i = 0 ; i < iNum ; i++ )
{
Player = iPlayers[i];
g_iLastRoundMoney[Player] = cs_get_user_money(Player)
}
}
public fw_Player_Spawn_Post(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
set_task(0.1, "SetMoney", id) //Set bit delay to replace the default bonus Win/Lose
}
public SetMoney(id)
{
new money = cs_get_user_money(id)
if(g_FirstRound == 1)
cs_set_user_money(id, 1000) //For the first round
else
cs_set_user_money(id, g_iLastRoundMoney[id]+3000) //Second round onward
cs_set_user_money(id, min(16000, money))
}