Raised This Month: $ Target: $400
 0% 

[help] with zp aps leader


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nomat
Member
Join Date: Apr 2011
Location: Moldova, Republic of
Old 12-03-2011 , 15:35   [help] with zp aps leader
Reply With Quote #1

I put on my server zombie plague 4.3 fix5a, after i put zp aps leader i still get this error , didn't work:
[AMXX] Run time error 10 (plugin "zp_aps_leader.amxx") (native "zp_get_user_ammo_packs") - debug not enabled!

after i put debug i got in console this errors:
[AMXX] Displaying debug trace (plugin "zp_aps_leader.amxx")
[AMXX] Run time error 10: native error (native "zp_get_user_ammo_packs")
[AMXX] [0] zp_aps_leader.sma::CheckLeader (line 87)
[AMXX] [0] zp_aps_leader.sma::Leader (line 62)


Help pls....
Quote:
#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 MaxPlayers, SayText

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

// Language Files
register_dictionary("aps_leader.txt")

// Cvars
leader_msj = register_cvar("zp_leader_msj", "1")
/*
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")
register_clcmd("say_team /leader", "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) == 1 || get_pcvar_num(leader_msj) == 3 )
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) == 1 || get_pcvar_num(leader_msj) == 3 )
{
new iAmmoPacks
new iLeader = GetLeader(iAmmoPacks)
new Players = UsersGetPlaying()
new iPlayers[32], iNum, Others
new szName[32]
get_user_name( iLeader, szName, 31 )
get_players( iPlayers, iNum, "ch" )

for ( new i = 0; i < iNum; i++ )
Others = zp_get_user_ammo_packs(i)

if ( Players == 0 )
ChatColor( 0, "%L", LANG_PLAYER, "NO_PLAYERS" )
else if ( iAmmoPacks == Others )
ChatColor( 0, "%L", LANG_PLAYER, "MORE_LEADERS" )
else
ChatColor( 0, "%L", LANG_PLAYER, "LEADER", szName, iAmmoPacks )
}
}

// Check Leader
public CheckLeader(id)
{
if ( get_pcvar_num(leader_msj) == 2 || get_pcvar_num(leader_msj) == 3 )
{
new iAmmoPacks
new iLeader = GetLeader(iAmmoPacks)
new Players = UsersGetPlaying()
new iPlayers[32], iNum, Others
new szName[32]
get_user_name( iLeader, szName, 31 )
get_players( iPlayers, iNum, "ch" )

for ( new i = 0; i < iNum; i++ )
Others = zp_get_user_ammo_packs(i)

if ( Players == 0 )
ChatColor( id, "%L", LANG_PLAYER, "NO_PLAYERS" )
else if ( iAmmoPacks == Others )
ChatColor( id, "%L", LANG_PLAYER, "MORE_LEADERS" )
else
ChatColor( id, "%L", LANG_PLAYER, "LEADER", szName, iAmmoPacks )
}

return PLUGIN_HANDLED;
}

GetLeader( &iAmmoPacks )
{
new iPlayers[32], iNum, id, i, iLeader, iPacks
get_players( iPlayers, iNum, "ch" )

for ( i = 0; i < iNum; i++ )
{
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 = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!t", "^3") // Team Color

if (id) players[0] = id; else get_players(players, count, "ch")
{
for ( new i = 0; i < count; i++ )
{
if ( is_user_connected(players[i]) )
{
message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}

// Users Get Playing (Stock from the ZP)
UsersGetPlaying()
{
static iPlaying, id
iPlaying = 0

for ( id = 1; id <= MaxPlayers; id++ )
{
if ( is_user_connected(id) )
{
if ( get_user_team(id) == 1 || get_user_team(id) == 2 )
iPlaying++
}
}

return iPlaying;
}

Last edited by nomat; 12-03-2011 at 15:35.
nomat is offline
Send a message via Skype™ to nomat
DeMNiX
Veteran Member
Join Date: Nov 2011
Location: Russia
Old 12-03-2011 , 23:38   Re: [help] with zp aps leader
Reply With Quote #2

maybe 65 & 90
Quote:
zp_get_user_ammo_packs(i)
==>
Quote:
zp_get_user_ammo_packs(id)
???

Last edited by DeMNiX; 12-03-2011 at 23:40.
DeMNiX is offline
nomat
Member
Join Date: Apr 2011
Location: Moldova, Republic of
Old 12-04-2011 , 05:42   Re: [help] with zp aps leader
Reply With Quote #3

dont help
nomat is offline
Send a message via Skype™ to nomat
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 12-04-2011 , 08:36   Re: [help] with zp aps leader
Reply With Quote #4

Try this one..
Attached Files
File Type: sma Get Plugin or Get Source (zp aps leader.sma - 2680 views - 5.8 KB)
__________________
H.RED.ZONE is offline
nomat
Member
Join Date: Apr 2011
Location: Moldova, Republic of
Old 12-04-2011 , 11:22   Re: [help] with zp aps leader
Reply With Quote #5

thx works perfectly
nomat is offline
Send a message via Skype™ to nomat
Slavut1chh
Member
Join Date: Jul 2010
Location: N/A
Old 12-26-2011 , 12:59   Re: [help] with zp aps leader
Reply With Quote #6

L 12/26/2011 - 116:11: [ZP] Invalid Player (0)
L 12/26/2011 - 116:11: [AMXX] Displaying debug trace (plugin "zp_aps_leader.amxx")
L 12/26/2011 - 116:11: [AMXX] Run time error 10: native error (native "zp_get_user_ammo_packs")
L 12/26/2011 - 116:11: [AMXX] [0] zp_aps_leader.sma::CheckLeader_Ammo (line 112)

L 12/26/2011 - 116:18: [ZP] Invalid Player (15)
L 12/26/2011 - 116:18: [AMXX] Displaying debug trace (plugin "zp_sub_rewards.amxx")
L 12/26/2011 - 116:18: [AMXX] Run time error 10: native error (native "zp_get_user_zombie")
L 12/26/2011 - 116:18: [AMXX] [0] zp_sub_rewards.sma::zp_round_ended (line 460)

also i get "ml not found"
__________________
Quote:
Originally Posted by tei1995 View Post
nobody care about fps when play zombie mod

Last edited by Slavut1chh; 12-26-2011 at 12:59.
Slavut1chh is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 12-26-2011 , 13:05   Re: [help] with zp aps leader
Reply With Quote #7

Quote:
Originally Posted by Slavut1chh View Post
L 12/26/2011 - 116:11: [ZP] Invalid Player (0)
L 12/26/2011 - 116:11: [AMXX] Displaying debug trace (plugin "zp_aps_leader.amxx")
L 12/26/2011 - 116:11: [AMXX] Run time error 10: native error (native "zp_get_user_ammo_packs")
L 12/26/2011 - 116:11: [AMXX] [0] zp_aps_leader.sma::CheckLeader_Ammo (line 112)

L 12/26/2011 - 116:18: [ZP] Invalid Player (15)
L 12/26/2011 - 116:18: [AMXX] Displaying debug trace (plugin "zp_sub_rewards.amxx")
L 12/26/2011 - 116:18: [AMXX] Run time error 10: native error (native "zp_get_user_zombie")
L 12/26/2011 - 116:18: [AMXX] [0] zp_sub_rewards.sma::zp_round_ended (line 460)

also i get "ml not found"
Did you try this one http://forums.alliedmods.net/showpos...97&postcount=4
__________________
H.RED.ZONE is offline
Slavut1chh
Member
Join Date: Jul 2010
Location: N/A
Old 12-26-2011 , 13:17   Re: [help] with zp aps leader
Reply With Quote #8

Yes.
I get here the same errors as from official plugin + i get additional "ml not found " error
__________________
Quote:
Originally Posted by tei1995 View Post
nobody care about fps when play zombie mod
Slavut1chh is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 12-26-2011 , 14:45   Re: [help] with zp aps leader
Reply With Quote #9

Quote:
Originally Posted by Slavut1chh View Post
Yes.
I get here the same errors as from official plugin + i get additional "ml not found " error
For ml not found just put this in /data/lang/...
2 error is from other plugin remove it....that reward plugin
Attached Files
File Type: txt aps_leader.txt (734 Bytes, 602 views)
__________________

Last edited by H.RED.ZONE; 12-26-2011 at 14:46.
H.RED.ZONE is offline
Slavut1chh
Member
Join Date: Jul 2010
Location: N/A
Old 12-26-2011 , 14:54   Re: [help] with zp aps leader
Reply With Quote #10

Oh my fault.. and for the 1st error?
It doesn`t even show correctly my aps...
i have 54 ammopacks
it says the leader have 22 ammo packs...
__________________
Quote:
Originally Posted by tei1995 View Post
nobody care about fps when play zombie mod
Slavut1chh 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:46.


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