Raised This Month: $ Target: $400
 0% 

round money help


Post New Thread Reply   
 
Thread Tools Display Modes
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
sylar02
Member
Join Date: Jun 2011
Old 12-13-2011 , 18:58   Re: round money help
Reply With Quote #2

can somebody help me?
sylar02 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-14-2011 , 00:51   Re: round money help
Reply With Quote #3

It should be due to another plugin.
Also it would be better to use player spawn so you are sure to retrieve the real team and you don't have to loop through all players.


(userTeam == 2) && (userTeam != 1||3||0)

LoL
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sylar02
Member
Join Date: Jun 2011
Old 12-14-2011 , 02:14   Re: round money help
Reply With Quote #4

could u elaborate on player spawn, like what it is and a sample code snippet.

also what should be return type here.

i tried your suggestion and put return type as plugin_handled incase something is messing it up.(http://forums.alliedmods.net/showthread.php?t=10493). now, it would give me money in the end round for some reason.

for instance, lets say ts win the round. and there is message and sound saying terrorist win. and there is a delay of about 1-2 secs till new round begins.

it gave me money after the terrorist win sound came, and before new round started.

and i dont think there are any other plugins that would cause an error

Code:
name version author file status 
[ 1] Advanced Bans 0.8 Exolent advanced_bans_s running 
[ 2] [CSAC]CrossServerAdmin 2.0.3 KoST amx_need.amxx running 
[ 3] Admin Base 1.8.1.3746 AMXX Dev Team admin.amxx running 
[ 4] Admin Commands 1.8.1.3746 AMXX Dev Team admincmd.amxx running 
[ 5] Admin Help 1.8.1.3746 AMXX Dev Team adminhelp.amxx running 
[ 6] Menus Front-End 1.8.1.3746 AMXX Dev Team menufront.amxx running 
[ 7] Players Menu 1.8.1.3746 AMXX Dev Team plmenu.amxx running 
[ 8] Admin Chat 1.8.1.3746 AMXX Dev Team adminchat.amxx running 
[ 9] Anti Flood 1.8.1.3746 AMXX Dev Team antiflood.amxx running 
[ 10] Admin Votes 1.8.1.3746 AMXX Dev Team adminvote.amxx running 
[ 11] Nextmap Chooser 1.8.1.3746 AMXX Dev Team mapchooser.amxx running 
[ 12] TimeLeft 1.8.1.3746 AMXX Dev Team timeleft.amxx running 
[ 13] Pause Plugins 1.8.1.3746 AMXX Dev Team pausecfg.amxx running 
[ 14] Stats Configuration 1.8.1.3746 AMXX Dev Team statscfg.amxx running 
[ 15] Restrict Weapons 1.8.1.3746 AMXX Dev Team restmenu.amxx running 
[ 16] StatsX 1.8.1.3746 AMXX Dev Team statsx.amxx running 
[ 17] Autoresponder/Advertis 0.5 MaximusBrood ad_manager.amxx running 
[ 18] AMX Super 4.2 Bmann_420 amx_super.amxx running 
[ 19] round_money 0.7 SweatyBanana round_money.amx running 
[ 20] xREDIRECT 1.0.3.3 x0R xredirect.amxx running 
20 plugins, 20 running
sylar02 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-14-2011 , 02:36   Re: round money help
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("better_money","0.1","sylar")

    
/* Register LANG file */
    
register_dictionary("rmlang.txt")

    
RegisterHam(Ham_Spawn"player""CBasePlayer_Spawn_Post"true)
}

public 
CBasePlayer_Spawn_Postid )
{
    if( 
is_user_alive(id) )
    {
        new 
iMinMoney cs_get_user_team(id) == CS_TEAM_T 3000 3500
        
if( cs_get_user_money(id) < iMinMoney )
        {
            
cs_set_user_money(idiMinMoney)
            
client_print(idprint_chat"%L"id"MONEY_AMOUNT"iMinMoney)
        }
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 12-14-2011, 06:02
echo_cs
This message has been deleted by ConnorMcLeod. Reason: bullshit
Old 12-14-2011, 06:07
echo_cs
This message has been deleted by ConnorMcLeod. Reason: bullshit
Old 12-14-2011, 06:39
Devil259
This message has been deleted by ConnorMcLeod. Reason: answer to deleted post
Reply



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:05.


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