so here is what my plugin is suppose to do. when u join a server, it will give u 8000$ as start money. next, if you are ct and have less than 3500$, then it is suppose to set your money to 3500. so u can buy famas or stuff and arent completely broke. same goes for t side. if u have less than 3000 (t guns are less expensive) then plugin sets your money to 3000.
idea behind this plugin was to control awp whoring in my server (which is set to 16k, but give money to nub players incase if they are broke)
anyways, its having an issue where it gives money after 7-8 seconds. freeze time is 5 secs, and if i have less money, it gives me money to make purchases. but after i start walking around, it gives me money one more time. what am i doing wrong here?
sorry for nub mistakes if i made any, this is my first plugin
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
//new MONEY;
public plugin_init()
{
register_plugin("better_money","0.1","sylar")
//MONEY = register_cvar("round_money","16000")
/* Register LANG file */
register_dictionary("rmlang.txt")
//register_logevent("new_round", 2, "1=Round_Start")
register_event("HLTV", "new_round", "a")
}
public new_round()
{
new players[32], playerCount, i, player, ctMoney, tMoney, userTeam;
//pMoney = get_pcvar_num(MONEY)
ctMoney = 3500
tMoney = 3000
get_players(players,playerCount);
for(i=0;i<playerCount;i++)
{
player = players[i];
userTeam = get_user_team(player);
if((userTeam == 2) && (userTeam != 1||3||0) && (cs_get_user_money(player) < 3500))
{
cs_set_user_money(player, ctMoney);
client_print(player,print_chat,"%L",LANG_PLAYER,"MONEY_AMOUNT",ctMoney)
}
else if((userTeam == 1) && (userTeam != 0||2||3) && (cs_get_user_money(player) < 3000))
{
cs_set_user_money(player, tMoney);
client_print(player,print_chat,"%L",LANG_PLAYER,"MONEY_AMOUNT",tMoney)
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
based on this plugin
http://forums.alliedmods.net/showthread.php?p=221246