AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   P1mps Plugin Error Help (https://forums.alliedmods.net/showthread.php?t=220584)

devilicioux 07-12-2013 05:33

P1mps Plugin Error Help
 
L 07/12/2013 - 11:29:31: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20130712.log")
L 07/12/2013 - 11:29:31: [AMXX] Displaying debug trace (plugin "pimpspugfast.amxx")
L 07/12/2013 - 11:29:31: [AMXX] Run time error 4: index out of bounds
L 07/12/2013 - 11:29:31: [AMXX] [0] pimpspugfast.sma::enterLeaveRecord (line 2140)
L 07/12/2013 - 11:29:31: [AMXX] [1] pimpspugfast.sma::client_disconnect (line 1995)

Functions below.


new gLeftSteamIDs[33][128]

Below Bold Lines are the shown Error lines in functions and Declaration is above.

PHP Code:

public enterLeaveRecord(id)
{
    
get_user_authid(idgLeftSteamIDs[gLeftTimes], charsmax(gLeftSteamIDs[]))    //<-- Error Line
    
gLastTime[gLeftTimes++] = get_systime()


PHP Code:

public client_disconnect(id) {
    if ( 
is_user_bot(id) || is_user_hltv(id) || !( <= id <= gMaxPlayers ) )
        return 
PLUGIN_HANDLED
        
    
if ( id == gChangerID )
    {
        
gChangerID 0
        gChanging 
0
    
}
    
    else if ( 
id == gChangerID2 )
    {
        
gChangerID2 0
        gChanging2 
0
    
}
    
    if ( 
g_IsStarted )
    {
        
g_PugLeaves++
        
DidTK(id)
        
        if ( 
get_pcvar_num(cvar_RanksSystem) )
        {
            
gPoints[id] -= get_pcvar_num(cvar_LeavesMatchPoints)
            
enterLeaveRecord(id)                          //<---- Error Line
        
}
    }
        
    
CheckEmpty()
    
clear_list(id)
    
gDidPlayUntilEnd[id] = false
    g_LeftVotes
[id] = 0
    g_TotalKills
[id] = 0
    g_TotalDeaths
[id] = 0
    g_BombPlants
[id] = 0
    g_BombDefusions
[id] = 0
    
    
if ( g_givenChance[id] )
        
get_user_authid(idg_givenChanceSteamIDs[g_givenTimes++], charsmax(g_givenChanceSteamIDs[]))
    
g_givenChance[id] = false
    
    
if (g_bIsReady[id])
    {
        
gPlayersLeft++
    }
    
    
g_bIsReady[id] = false
    remove_task
(id)
    
remove_task(id+SET_CONST_TASKID)
    
    return 
PLUGIN_HANDLED



~Ice*shOt 07-12-2013 06:38

Re: P1mps Plugin Error Help
 
PHP Code:

new gLeftSteamIDs[33][128

Need to be constant. Because here

PHP Code:

get_user_authid(idgLeftSteamIDs[gLeftTimes], charsmax(gLeftSteamIDs[])) 

gLeftSteamIDs[gLeftTimes], charsmax(gLeftSteamIDs[]) You don't using indexes

devilicioux 07-12-2013 07:08

Re: P1mps Plugin Error Help
 
Quote:

Originally Posted by ~Ice*shOt (Post 1989240)
PHP Code:

new gLeftSteamIDs[33][128

Need to be constant. Because here

PHP Code:

get_user_authid(idgLeftSteamIDs[gLeftTimes], charsmax(gLeftSteamIDs[])) 

gLeftSteamIDs[gLeftTimes], charsmax(gLeftSteamIDs[]) You don't using indexes


So i should just make

new gLeftSteamIDs

to remove the error ?

YamiKaitou 07-12-2013 09:16

Re: P1mps Plugin Error Help
 
Quote:

Originally Posted by ~Ice*shOt (Post 1989240)
PHP Code:

new gLeftSteamIDs[33][128

Need to be constant. Because here

PHP Code:

get_user_authid(idgLeftSteamIDs[gLeftTimes], charsmax(gLeftSteamIDs[])) 

gLeftSteamIDs[gLeftTimes], charsmax(gLeftSteamIDs[]) You don't using indexes

Wrong



What is the value of gLeftTimes?

~Ice*shOt 07-12-2013 09:44

Re: P1mps Plugin Error Help
 
Oh. Or if gLeftTimes have index it must be used with index in function for example: gLeftSteamIDs[gLeftTimes[id]] but only if new gLeftTimes has index

YamiKaitou 07-12-2013 09:52

Re: Re: P1mps Plugin Error Help
 
Quote:

Originally Posted by ~Ice*shOt (Post 1989323)
Oh. Or if gLeftTimes have index it must be used with index in function for example: gLeftSteamIDs[gLeftTimes[id]] but only if new gLeftTimes has index

A different error would have been thrown then

devilicioux 07-13-2013 09:36

Re: P1mps Plugin Error Help
 
Thank you both for trying to help :) Here is the complete plugin i m using .. All i changed in the plugin is shorten the set_task times and made it a little fast.

http://forums.alliedmods.net/showthread.php?t=168906

YamiKaitou 07-13-2013 09:38

Re: P1mps Plugin Error Help
 
Then post in that thread about the error so the author can fix it himself

devilicioux 07-13-2013 10:33

Re: P1mps Plugin Error Help
 
He has replied there he is busy in his exams and all .. so he wont be able to support the plugin for now.Thats why i posted it here :(

Quote:

Originally Posted by YamiKaitou (Post 1989976)
Then post in that thread about the error so the author can fix it himself



All times are GMT -4. The time now is 06:20.

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