Raised This Month: $32 Target: $400
 8% 

Help / Support [HELP] Problem with ammo, frag leader


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 04-13-2012 , 04:29   [HELP] Problem with ammo, frag leader
Reply With Quote #1

Ive got this error
PHP Code:
L 04/13/2012 16:27:26: [XopoMInvalid Player (0)
L 04/13/2012 16:27:26: [AMXXDisplaying debug trace (plugin "zp_show_flags.amxx")
L 04/13/2012 16:27:26: [AMXXRun time error 10native error (native "zp_get_user_ammo_packs")
L 04/13/2012 16:27:26: [AMXX]    [0zp_show_flags.sma::CheckLeader (line 88)
L 04/13/2012 16:27:31: [XopoMInvalid Player (0)
L 04/13/2012 16:27:31: [AMXXDisplaying debug trace (plugin "zp_aps_leader.amxx")
L 04/13/2012 16:27:31: [AMXXRun time error 10native error (native "zp_get_user_ammo_packs")
L 04/13/2012 16:27:31: [AMXX]    [0zp_aps_leader.sma::CheckLeader_Ammo (line 112
from those codes...
zp_show_flags
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>

#define PLUGIN     "[ZP] Addon: APs Leader"
#define VERSION "1.2"
#define AUTHOR    "Kiske"

// Cvars
new leader_msj

// Others
new MaxPlayersSayText

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Language Files
    
register_dictionary("frag_leader.txt")
    
    
// Cvars
    
leader_msj register_cvar("zp_leader_msj""3")
    
/*
    zp_leader_msj 0. Plugin Disable.
    zp_leader_msj 1. Message at RoundStart.
    zp_leader_msj 2. Message when you say or say_team "/frag".
    zp_leader_msj 3. Both.
    */
    
    // Client Commands
    
register_clcmd("say /frag""CheckLeader")
    
register_clcmd("say_team /frag""CheckLeader")
    
    
// Event
    
register_event("HLTV""RoundStart""a""1=0""2=0")
    
    
// Others
    
SayText get_user_msgid("SayText")
    
MaxPlayers get_maxplayers()
}

public 
RoundStart()
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
        
set_task(2.2"Leader"// I use this set_task to the message appears then of "welcome_msg"
}

public 
Leader()
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
    {
        new 
iAmmoPacks
        
new iLeader GetLeader(iAmmoPacks)
        new 
Players UsersGetPlaying()
        new 
iPlayers[32], iNumOthers
        
new szName[32]
        static 
id
        get_user_name
iLeaderszName31 )
        
get_playersiPlayersiNum"ch" )
        
        for ( new 
0iNumi++ )
            
Others get_user_flags(i)
    
        if ( 
Players == )
            
ChatColor0"%L"LANG_PLAYER"NO_PLAYERS" )
        else if ( 
iAmmoPacks == Others )
            
ChatColor0"%L"LANG_PLAYER"MORE_LEADERS" )
        else
            
ChatColor0"%L"LANG_PLAYER"LEADER"szNameget_user_flags(id) )
    }
}

// Check Leader
public CheckLeader(id)
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
    {
        new 
iAmmoPacks
        
new iLeader GetLeader(iAmmoPacks)
        new 
Players UsersGetPlaying()
        new 
iPlayers[32], iNumOthers
        
new szName[32]
        
get_user_nameiLeaderszName31 )
        
get_playersiPlayersiNum"ch" )
        
        for ( new 
0iNumi++ )
            
Others zp_get_user_ammo_packs(i)
            
        if ( 
Players == )
            
ChatColorid"%L"LANG_PLAYER"NO_PLAYERS" )
        else if ( 
iAmmoPacks == Others )
            
ChatColorid"%L"LANG_PLAYER"MORE_LEADERS" )
        else
            
ChatColorid"%L"LANG_PLAYER"LEADER"szNameiAmmoPacks )
    }
    
    return 
PLUGIN_HANDLED;
}

GetLeader( &iAmmoPacks )
{
    new 
iPlayers[32], iNumidiiLeaderiPacks
    get_players
iPlayersiNum"ch" )
    
    for ( 
0iNumi++ )
    {
        
id iPlayers[i]
        
iPacks zp_get_user_ammo_packs(id)
        
        if ( 
iPacks iAmmoPacks )
        {
            
iAmmoPacks iPacks
            iLeader 
id
        
}
    }
    return 
iLeader;
}

// ChatColor!
stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!t""^3"// Team Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch"
    {
        for ( new 
0counti++ )
        {
            if ( 
is_user_connected(players[i]) )
            {
                
message_begin(MSG_ONE_UNRELIABLESayText_players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }
}

// Users Get Playing (Stock from the ZP)
UsersGetPlaying()
{
    static 
iPlayingid
    iPlaying 
0
    
    
for ( id 1id <= MaxPlayersid++ )
    {
        if ( 
is_user_connected(id) )
        {
            if ( 
get_user_team(id) == || get_user_team(id) == )
                
iPlaying++
        }
    }
    
    return 
iPlaying;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10266\\ f0\\ fs16 \n\\ par }
*/ 
zp_aps_leader
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>

#define PLUGIN     "[ZP] Addon: APs Leader"
#define VERSION "1.2"
#define AUTHOR    "Kiske"

// Cvars
new leader_msj

// Others
new MaxPlayersSayText

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Language Files
    
register_dictionary("frag_leader.txt")
    
    
// Cvars
    
leader_msj register_cvar("zp_leader_msj""3")
    
/*
    zp_leader_msj 0. Plugin Disable.
    zp_leader_msj 1. Message at RoundStart.
    zp_leader_msj 2. Message when you say or say_team "/frag".
    zp_leader_msj 3. Both.
    */
    
    // Client Commands
    
register_clcmd("say /frag""CheckLeader")
    
register_clcmd("say_team /frag""CheckLeader")
    
    
// Event
    
register_event("HLTV""RoundStart""a""1=0""2=0")
    
    
// Others
    
SayText get_user_msgid("SayText")
    
MaxPlayers get_maxplayers()
}

public 
RoundStart()
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
        
set_task(2.2"Leader"// I use this set_task to the message appears then of "welcome_msg"
}

public 
Leader()
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
    {
        new 
iAmmoPacks
        
new iLeader GetLeader(iAmmoPacks)
        new 
Players UsersGetPlaying()
        new 
iPlayers[32], iNumOthers
        
new szName[32]
        static 
id
        get_user_name
iLeaderszName31 )
        
get_playersiPlayersiNum"ch" )
        
        for ( new 
0iNumi++ )
            
Others get_user_flags(i)
    
        if ( 
Players == )
            
ChatColor0"%L"LANG_PLAYER"NO_PLAYERS" )
        else if ( 
iAmmoPacks == Others )
            
ChatColor0"%L"LANG_PLAYER"MORE_LEADERS" )
        else
            
ChatColor0"%L"LANG_PLAYER"LEADER"szNameget_user_flags(id) )
    }
}

// Check Leader
public CheckLeader(id)
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
    {
        new 
iAmmoPacks
        
new iLeader GetLeader(iAmmoPacks)
        new 
Players UsersGetPlaying()
        new 
iPlayers[32], iNumOthers
        
new szName[32]
        
get_user_nameiLeaderszName31 )
        
get_playersiPlayersiNum"ch" )
        
        for ( new 
0iNumi++ )
            
Others zp_get_user_ammo_packs(i)
            
        if ( 
Players == )
            
ChatColorid"%L"LANG_PLAYER"NO_PLAYERS" )
        else if ( 
iAmmoPacks == Others )
            
ChatColorid"%L"LANG_PLAYER"MORE_LEADERS" )
        else
            
ChatColorid"%L"LANG_PLAYER"LEADER"szNameiAmmoPacks )
    }
    
    return 
PLUGIN_HANDLED;
}

GetLeader( &iAmmoPacks )
{
    new 
iPlayers[32], iNumidiiLeaderiPacks
    get_players
iPlayersiNum"ch" )
    
    for ( 
0iNumi++ )
    {
        
id iPlayers[i]
        
iPacks zp_get_user_ammo_packs(id)
        
        if ( 
iPacks iAmmoPacks )
        {
            
iAmmoPacks iPacks
            iLeader 
id
        
}
    }
    return 
iLeader;
}

// ChatColor!
stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!t""^3"// Team Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch"
    {
        for ( new 
0counti++ )
        {
            if ( 
is_user_connected(players[i]) )
            {
                
message_begin(MSG_ONE_UNRELIABLESayText_players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }
}

// Users Get Playing (Stock from the ZP)
UsersGetPlaying()
{
    static 
iPlayingid
    iPlaying 
0
    
    
for ( id 1id <= MaxPlayersid++ )
    {
        if ( 
is_user_connected(id) )
        {
            if ( 
get_user_team(id) == || get_user_team(id) == )
                
iPlaying++
        }
    }
    
    return 
iPlaying;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang10266\\ f0\\ fs16 \n\\ par }
*/ 
__________________
naSTR is offline
Old 04-13-2012, 09:10
JoKeR LauGh
This message has been deleted by JoKeR LauGh.
ESPADONGAMING
Senior Member
Join Date: Mar 2011
Location: In the Game [ro]
Old 04-13-2012 , 16:34   Re: [HELP] Problem with ammo, frag leader
Reply With Quote #2

Edit by H.RED.ZONE

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

#define PLUGIN     "[ZP] Addon: APs Leader"
#define VERSION "1.2"
#define AUTHOR    "Kiske"

// Cvars
new leader_msj

// Others
new MaxPlayersSayText

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Language Files
    
register_dictionary("aps_leader.txt")
    
    
// Cvars
    
leader_msj register_cvar("zp_leader_msj""3")
    
/*
    zp_leader_msj 0. Plugin Disable.
    zp_leader_msj 1. Message at RoundStart.
    zp_leader_msj 2. Message when you say or say_team "/leader".
    zp_leader_msj 3. Both.
    */
    
    // Client Commands
    
register_clcmd("say /leader""CheckLeader_Ammo")
    
register_clcmd("say_team /leader""CheckLeader_Ammo")
    
    
// Event
    
register_event("HLTV""RoundStart""a""1=0""2=0")
    
    
// Others
    
SayText get_user_msgid("SayText")
    
MaxPlayers get_maxplayers()
}

public 
RoundStart()
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
        
set_task(1.6"Leader"// I use this set_task to the message appears then of "welcome_msg"
}

public 
Leader()
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
    {
        new 
iAmmoPacks
        
new iLeader GetLeader_Ammo(iAmmoPacks)
        new 
Players UsersGetPlaying()
        new 
iPlayers[32], iNumOthers
        
new szName[32]
        
get_user_nameiLeaderszName31 )
        
get_playersiPlayersiNum"ch" )
       
        if ( 
Players == )
            
ChatColor0"%L"LANG_PLAYER"NO_PLAYERS" )
        else if ( 
iAmmoPacks == Others )
            
ChatColor0"%L"LANG_PLAYER"MORE_LEADERS_AMMO" )
        else
            
ChatColor0"%L"LANG_PLAYER"LEADER_AMMO"szNameiAmmoPacks )
    }
    
set_task(0.1"Leader_Frags")
}

public 
Leader_Frags()
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
    {
        new 
iFrags
        
new iLeader GetLeader_Frags(iFrags)
        new 
Players UsersGetPlaying()
        new 
iPlayers[32], iNumOthers
        
new szName[32]
        
get_user_nameiLeaderszName31 )
        
get_playersiPlayersiNum"ch" )
        
        for ( new 
0iNumi++ )
            
Others get_user_frags(i)
    
        if ( 
Players == )
            
ChatColor0"%L"LANG_PLAYER"NO_PLAYERS" )
        else if ( 
iFrags == Others )
            
ChatColor0"%L"LANG_PLAYER"MORE_LEADERS_FRAGS" )
        else
            
ChatColor0"%L"LANG_PLAYER"LEADER_FRAGS"szNameiFrags )
    }
}

// Check Leader
public CheckLeader_Ammo(id)
{
    if ( 
get_pcvar_num(leader_msj) == || get_pcvar_num(leader_msj) == )
    {
        new 
iAmmoPacksiFrags
        
new iLeader_Ammo GetLeader_Ammo(iAmmoPacks)
        new 
iLeader_Frags GetLeader_Frags(iFrags)
        new 
Players UsersGetPlaying()
        new 
iPlayers[32], iNumOthersAltii
        
new Name_Frags[32], Name_Ammo[32]
        
get_user_nameiLeader_FragsName_Frags31 )
        
get_user_nameiLeader_AmmoName_Ammo31 )
        
get_playersiPlayersiNum"ch" )
        
        for ( new 
0iNumi++ )
            
Others zp_get_user_ammo_packs(i)

        for ( new 
0iNumj++ )
            
Altii get_user_frags(j)
            
        if ( 
Players == )
            
ChatColorid"%L"LANG_PLAYER"NO_PLAYERS" )
        else if ( 
iFrags == Altii )
            
ChatColorid"%L"LANG_PLAYER"MORE_LEADERS_FRAGS" )
        else if ( 
iAmmoPacks == Others )
            
ChatColorid"%L"LANG_PLAYER"MORE_LEADERS_AMMO" )
        else
        
ChatColorid"%L"LANG_PLAYER"LEADER_AMMO"Name_AmmoiAmmoPacks )
    }
    
    return 
PLUGIN_HANDLED;
}

GetLeader_Ammo( &iAmmoPacks )
{
    new 
iPlayers[32], iNumidiiLeaderiPacks
    get_players
iPlayersiNum"ch" )
    
    for ( 
0iNumi++ )
    {
        
id iPlayers[i]
        
iPacks zp_get_user_ammo_packs(id)
        
        if ( 
iPacks iAmmoPacks )
        {
            
iAmmoPacks iPacks
            iLeader 
id
        
}
    }
    return 
iLeader;
}

GetLeader_Frags( &iFrags )
{
    new 
iPlayers[32], iNumidiiLeaderiFrag
    get_players
iPlayersiNum"ch" )
    
    for ( 
0iNumi++ )
    {
        
id iPlayers[i]
        
iFrag get_user_frags(id)
        
        if ( 
iFrag iFrags )
        {
            
iFrags iFrag
            iLeader 
id
        
}
    }
    return 
iLeader;
}

// ChatColor!
stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!t""^3"// Team Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch"
    {
        for ( new 
0counti++ )
        {
            if ( 
is_user_connected(players[i]) )
            {
                
message_begin(MSG_ONE_UNRELIABLESayText_players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }
}

// Users Get Playing (Stock from the ZP)
UsersGetPlaying()
{
    static 
iPlayingid
    iPlaying 
0
    
    
for ( id 1id <= MaxPlayersid++ )
    {
        if ( 
is_user_connected(id) )
        {
            if ( 
get_user_team(id) == || get_user_team(id) == )
                
iPlaying++
        }
    }
    
    return 
iPlaying;

PHP Code:
[en]
LEADER_FRAGS = !g[ZP] !yThe frags leader is !g%!y@ !g%d Frags!y.
LEADER_AMMO = !g[ZP] !yThe packs leader is !g%!y@ !g%d AmmoPacks!y.
NO_PLAYERS = !g[ZP] !yThere are not players connected.
MORE_LEADERS_FRAGS = !g[ZP] !yThere is more with one player with the same Fragsthere is no leader.
MORE_LEADERS_AMMO = !g[ZP] !yThere is more with one player with the same AmmoPacksthere is no leader
__________________
Skype: cristi.c94
SteamID: cristic_1994
ESPADONGAMING is offline
Send a message via MSN to ESPADONGAMING Send a message via Yahoo to ESPADONGAMING Send a message via Skype™ to ESPADONGAMING
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 04-13-2012 , 17:37   Re: [HELP] Problem with ammo, frag leader
Reply With Quote #3

thanks for helping me =)
It works great.
__________________
naSTR is offline
saywow
Senior Member
Join Date: Oct 2010
Old 04-14-2012 , 09:52   Re: [HELP] Problem with ammo, frag leader
Reply With Quote #4

Can you upload the .txt file naSTR ? please , because the original one don't work, i have always ml_notfound
__________________
saywow is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 04-14-2012 , 09:57   Re: [HELP] Problem with ammo, frag leader
Reply With Quote #5

Create

aps_leader.txt

And copy inside....

Code:
[en]
LEADER_FRAGS = !g[ZP] !yThe frags leader is !g%s !y@ !g%d Frags!y.
LEADER_AMMO = !g[ZP] !yThe packs leader is !g%s !y@ !g%d AmmoPacks!y.
NO_PLAYERS = !g[ZP] !yThere are not players connected.
MORE_LEADERS_FRAGS = !g[ZP] !yThere is more with one player with the same Frags, there is no leader.
MORE_LEADERS_AMMO = !g[ZP] !yThere is more with one player with the same AmmoPacks, there is no leader.
After that set it in data/lang/...

__________________
H.RED.ZONE is offline
saywow
Senior Member
Join Date: Oct 2010
Old 04-14-2012 , 09:58   Re: [HELP] Problem with ammo, frag leader
Reply With Quote #6

oki thank you !
__________________
saywow 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:39.


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