Raised This Month: $ Target: $400
 0% 

round money help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sylar02
Member
Join Date: Jun 2011
Old 12-12-2011 , 01:49   round money help
Reply With Quote #1

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], playerCountiplayerctMoneytMoneyuserTeam;
    
//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(playerctMoney);
            
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(playertMoney);
            
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

Last edited by sylar02; 12-12-2011 at 01:50.
sylar02 is offline
 



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 12:06.


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