Raised This Month: $ Target: $400
 0% 

Fix plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 10-27-2011 , 12:39   Fix plugin.
Reply With Quote #1

Hi all, this plugin takes the money and gievs them on the next round but it doesn`t work correctly can someone fix it?

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

new iGetUserMoney[33], iRound;

public 
plugin_init()
{
    
register_plugin("Round Money Remove""1.0""kostov");
    
    
register_event("TextMsg""eGetMoney""a""2&#Game_w");
    
register_logevent("iNewRound"2"1=Round_Start");
    
register_logevent("iEndRound"2"1=Round_End");
}

public 
eGetMoney()
{
    new 
iPlayers[32], iNumiPlayer;
    
get_players(iPlayersiNum"ch");
    
    if(
iNum <= 1)
    {
        return 
PLUGIN_CONTINUE;
    }
    
    if(
iRound == 1)
    {
        return 
PLUGIN_CONTINUE;
    }
    
    for(new 
0iNumi++) 
    {
        
iPlayer iPlayers[i];
        
        
iGetUserMoney[iPlayer] == cs_get_user_money(iPlayer);
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
iEndRound()
{
    ++
iRound;
}

public 
iNewRound()
{
    new 
iPlayers[32], iNumiPlayer;
    
get_players(iPlayersiNum"ch");
    
    if(
iNum <= 1)
    {
        return 
PLUGIN_CONTINUE;
    }
    
    if(
iRound == 1)
    {
        return 
PLUGIN_CONTINUE;
    }
    
    for(new 
0iNumi++) 
    {
        
iPlayer iPlayers[i];
        
        
cs_set_user_money(iPlayeriGetUserMoney[iPlayer]);
    }
    
    return 
PLUGIN_CONTINUE;

Lolz0r is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-27-2011 , 13:10   Re: Fix plugin.
Reply With Quote #2

What the function of this plugin?
__________________
kramesa is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 10-27-2011 , 13:21   Re: Fix plugin.
Reply With Quote #3

So basically this plugin takes all of your money in the end of the round and retruns them in the beginning of the next, but unfortunately it doesn't work. Could you fix it?
Lolz0r is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-27-2011 , 13:32   Re: Fix plugin.
Reply With Quote #4

Plugin works perfectly. You have cstrike dll?
__________________
kramesa is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 10-27-2011 , 13:50   Re: Fix plugin.
Reply With Quote #5

I'm using this plugin:

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define VERSION    "1.0"

new g_iHostageZone;

public 
plugin_init(){ 
    
register_plugin("Hostage Entity"VERSION"kostov");
    
register_cvar("hostage_zone_version"VERSIONFCVAR_SERVER|FCVAR_SPONLY);
    
set_cvar_string("hostage_zone_version",    VERSION);
}

public 
plugin_precache(){
    
register_forward(FM_Spawn"HostageSpawn"0);
    new 
CreateHostageEnt engfunc(EngFunc_AllocString"hostage_entity");
    do{
        
g_iHostageZone engfunc(EngFunc_CreateNamedEntityCreateHostageEnt);}
    while(!
pev_valid(g_iHostageZone));
    
engfunc(EngFunc_SetSizeg_iHostageZoneFloat:{-1.0, -1.0, -1.0}, Float:{1.01.01.0});
    
engfunc(EngFunc_SetOriging_iHostageZoneFloat:{0.00.0, -55000.0});
    
dllfunc(DLLFunc_Spawng_iHostageZone);
    return 
PLUGIN_CONTINUE;
}

public 
HostageSpawn(id){
    if(!
pev_valid(id) || id == g_iHostageZone){
        return 
FMRES_IGNORED;}
    new 
g_sClass[32];
    
pev(idpev_classnameg_sClass31);
    return 
FMRES_IGNORED;

It restarts the round on maps wit no active entity by creating an invisible zone with hostages, everything works alright but when the round gets restarted both team's players are with 0$, so that I need a plugin that takes off all the money of each player in the end of the round and returns them in the beginning of the next.

Last edited by Lolz0r; 10-27-2011 at 13:50.
Lolz0r is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 10-27-2011 , 14:39   Re: Fix plugin.
Reply With Quote #6

Try changing the order of the plugins in your config file. Put the one with the money transfer first.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 10-27-2011 , 15:52   Re: Fix plugin.
Reply With Quote #7

No change. The same problem.
Lolz0r is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-27-2011 , 17:35   Re: Fix plugin.
Reply With Quote #8

Check your modules.ini (cstrike module)

Try it:

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

new iGetUserMoney[33], iRound

public 
plugin_init() 

    
register_plugin("Round Money Remove""1.0""kostov"); 
     
    
register_event("TextMsg""eGetMoney""a""2&#Game_w"); 
    
register_logevent("iNewRound"2"1=Round_Start"); 
    
register_logevent("iEndRound"2"1=Round_End"); 


public 
eGetMoney() 

    new 
iPlayers[32], iNumiPlayer
    
get_players(iPlayersiNum"ch"); 
     
    if(
iNum <= 1
    { 
        return 
PLUGIN_CONTINUE
    } 
     
    if(
iRound == 1
    { 
        return 
PLUGIN_CONTINUE
    } 
     
    for(new 
0iNumi++)  
    { 
        
iPlayer iPlayers[i]; 
         
        
iGetUserMoney[iPlayer] == cs_get_user_money(iPlayer); 
    } 
     
    return 
PLUGIN_CONTINUE


public 
iEndRound() 

    ++
iRound


public 
iNewRound() 

    new 
iPlayers[32], iNumiPlayer
    
get_players(iPlayersiNum"ch"); 
     
    if(
iNum <= 1
    { 
        return 
PLUGIN_CONTINUE
    } 
     
    if(
iRound == 1
    { 
        return 
PLUGIN_CONTINUE
    } 
     
    for(new 
0iNumi++)  
    { 
        
iPlayer iPlayers[i]; 
         
        
cs_set_user_money(iPlayeriGetUserMoney[iPlayer]); 
    } 
     
    return 
PLUGIN_CONTINUE

Works perfectly.
__________________
kramesa is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 10-27-2011 , 18:30   Re: Fix plugin.
Reply With Quote #9

Here is another possible solution:
https://forums.alliedmods.net/showthread.php?t=126821
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 10-28-2011 , 16:07   Re: Fix plugin.
Reply With Quote #10

@kramesa, the same thing again.

@joshknifer, I got the following errors with that plugin:


Code:
L 10/28/2011 - 23:04:34: [CSTRIKE] Invalid player 1
L 10/28/2011 - 23:04:34: [AMXX] Displaying debug trace (plugin "axa1.amxx")
L 10/28/2011 - 23:04:34: [AMXX] Run time error 10: native error (native "cs_set_user_money")
L 10/28/2011 - 23:04:34: [AMXX]    [0] axa1.sma::HamSpawnPost (line 43)
Lolz0r is offline
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 14:20.


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