Thanks Jon!
I'm wondering how i can add this script the best onthe existing plugin, maybe you can jelp me out because honestly said i've no idea.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#define MAX_PLAYERS 32
#define OFFSET_CSMONEY 115
new bool:g_bRestartAttempt[MAX_PLAYERS+1]
new g_pcvarRoundStartMoney
new g_msgidMoney
public plugin_init()
{
register_plugin("Round StartMoney", "1.0", "ConnorMcLeod")
register_cvar("amx_startmoney", "3500")
register_event("TextMsg", "eRestartAttempt", "a", "2=#Game_will_restart_in")
register_event("ResetHUD", "eResetHUD", "be")
register_clcmd("fullupdate", "fullupdateCmd")
}
public plugin_cfg()
{
g_msgidMoney = get_user_msgid("Money")
g_pcvarRoundStartMoney = get_cvar_pointer("amx_startmoney")
}
public fullupdateCmd() {
return PLUGIN_HANDLED_MAIN
}
public eRestartAttempt() {
new players[MAX_PLAYERS], num
get_players(players, num, "a")
for (new i; i < num; ++i)
g_bRestartAttempt[players[i]] = true
}
public eResetHUD(id) {
if (g_bRestartAttempt[id]) {
g_bRestartAttempt[id] = false
return
}
event_player_spawn(id)
}
event_player_spawn(id) {
new iStartMoney = get_pcvar_num(g_pcvarRoundStartMoney)
if(get_pdata_int(id, OFFSET_CSMONEY) >= iStartMoney)
return
set_pdata_int(id, OFFSET_CSMONEY, iStartMoney)
message_begin(MSG_ONE_UNRELIABLE, g_msgidMoney, _, id)
write_long(iStartMoney)
write_byte(1)
message_end()
}
__________________