AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help - plugin bug (https://forums.alliedmods.net/showthread.php?t=298866)

plazma 06-24-2017 13:36

Help - plugin bug
 
Im trying to fix but i can t.

logs:
Code:

L 06/24/2017 - 19:10:36: [AMXX] Displaying debug trace (plugin "level.amxx")
L 06/24/2017 - 19:10:36: [AMXX] Run time error 4: index out of bounds
L 06/24/2017 - 19:10:36: [AMXX]    [0] level.sma::myxp (line 686)

Line:
PHP Code:

public myxp(id)
{
    while(
PlayerXP[id] >= LEVELS[PlayerLevel[id]]) // Here is the bug
    

        
ColorChat(idRED"TEST TXT")
        
PlayerLevel[id] += 1
        
        SaveData
(id)
    }



source:
PHP Code:

public EventRoundStart(id)
{
    new 
iPlayers[32], iNum;
    
get_playersiPlayersiNum );
    
    for( new 
0g<iNum ;g++ )
    {
        new 
id iPlayers[g];

        
set_task(1.0"myxp"id);
        
    }



Natsheh 06-24-2017 14:09

Re: Help - plugin bug
 
Omg for fucking thousands time there isnt a parameters (id) passed in round start event..

PHP Code:

public myxp(id

    while(
PlayerXP[id] >= LEVELS[PlayerLevel[id]]) // Here is the bug 
    
{  
        
ColorChat(idRED"TEST TXT"
        
PlayerLevel[id] += 
         
        SaveData
(id
    } 


:arrow:

PHP Code:

public myxp(id

    if(
PlayerXP[id] > LEVELS[PlayerLevel[id]]) // Here is the bug 
    
{  
        
ColorChat(idRED"TEST TXT"
        
PlayerLevel[id] += 
         
        SaveData
(id
    } 



Probably...


All times are GMT -4. The time now is 23:02.

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