Kelių pluginų klaidų taisymas.

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Post Reply
OriGinal
O taip. Jis jau surinko 50 žinučių!
Posts: 81
Joined: 2011 Mar 12 23:27
Skype: aurintas2

Kelių pluginų klaidų taisymas.

Post by OriGinal »

Sveiki, prireikė pagalbos. Reiktų ištaisyti kelis Counter-Strike 1.6 pluginus. Pradedam:

#1 - xredirect.amxx

Klaida:

Code: Select all

L 07/23/2011 - 16:40:50: [AMXX] Displaying debug trace (plugin "xredirect.amxx")L 07/23/2011 - 16:40:50: [AMXX] Run time error 4: index out of bounds L 07/23/2011 - 16:40:50: [AMXX]    [0] phpXUhFmM.sma::welcome_message (line 2005)
Klaidos vieta:

Code: Select all

public welcome_message(id[]){    new nID = id[0]    if (is_user_connected(nID)) // make sure the player didn't already disconnect within the set_task delay    {        new nLastServer = g_nLastServer[nID - 1]        if ((nLastServer >= 0) && (nLastServer != g_nOwnServer) && (nLastServer < MAX_SERVERFORWARDS))        {            new sAnnounceText[MAX_WELCOME_LEN]            format(sAnnounceText, MAX_WELCOME_LEN - 1, "%L", nID, "MSG_REDIRFROM", g_saServerNames[g_nOwnServer], g_saServerNames[nLastServer])            if ((get_pcvar_num(cvar_retry) == 1) && (get_pcvar_num(cvar_show) == 1))                format(sAnnounceText, MAX_WELCOME_LEN - 1, "%s^n%L", sAnnounceText, nID, "MSG_RETRY_BACK_ANNOUNCE")                        set_hudmessage(000, 100, 255, -1.0, -1.0, 0, 0.0, 10.0, 0.5, 2.0, 1)            show_hudmessage(nID, sAnnounceText)        }    }}
#2 - freeknife.amxx

Klaida:

Code: Select all

L 07/20/2011 - 11:56:14: [CSTRIKE] Invalid player 2L 07/20/2011 - 11:56:14: [AMXX] Displaying debug trace (plugin "freeknife.amxx")L 07/20/2011 - 11:56:14: [AMXX] Run time error 10: native error (native "cs_get_user_team")L 07/20/2011 - 11:56:14: [AMXX]    [0] phpYuP4uB.sma::CmdFreeRound (line 87)
Klaidos vieta:

Code: Select all

public CmdFreeRound( id ) {    if( cs_get_user_team( id ) != CS_TEAM_T )     {        GreenPrint( id, "%L", LANG_SERVER, "ONLY_T" );                return PLUGIN_CONTINUE;    }    else if( g_bFreeRound )     {        GreenPrint( id, "%L", LANG_SERVER, "READY_KNIFE" );                return PLUGIN_CONTINUE;    }    else if(!mygtukai)    {        GreenPrint( id, "%L", LANG_SERVER, "TURN_ON" );                return PLUGIN_CONTINUE;    }    g_iRounds = 0;    g_bWillFree = false;    g_bFreeRound = true;    PrintMessage( )         return PLUGIN_CONTINUE;}
Dėkui už pagalbą. :)

User avatar
psychical
Viršininkas
Posts: 2094
Joined: 2011 Mar 12 22:19
Skype: tautvydas11
Location: Linksmakalnis
Contact:

Re: Kelių pluginų klaidų taisymas.

Post by psychical »

1. Nueini į .sma susirandi:

Code: Select all

// plugin defines#define PLUGIN_NAME "xREDIRECT"#define PLUGIN_VERSION "1.0.3.3"#define PLUGIN_AUTHOR "x0R"#define PLUGIN_TAG "[xREDIRECT]" 
po juo įterpi:

Code: Select all

 #define is_valid_player(%1) (1 <= %1 <= 32)
Bent jau man padėjo ;)


2.

Code: Select all

public CmdFreeRound( id ) {    if(!is_user_connected(id))        return PLUGIN_HANDLED;     if( cs_get_user_team( id ) != CS_TEAM_T )     {        GreenPrint( id, "%L", LANG_SERVER, "ONLY_T" );                return PLUGIN_CONTINUE;    }    else if( g_bFreeRound )     {        GreenPrint( id, "%L", LANG_SERVER, "READY_KNIFE" );                return PLUGIN_CONTINUE;    }    else if(!mygtukai)    {        GreenPrint( id, "%L", LANG_SERVER, "TURN_ON" );                return PLUGIN_CONTINUE;    }    g_iRounds = 0;    g_bWillFree = false;    g_bFreeRound = true;    PrintMessage( )         return PLUGIN_CONTINUE;}

OriGinal
O taip. Jis jau surinko 50 žinučių!
Posts: 81
Joined: 2011 Mar 12 23:27
Skype: aurintas2

Re: Kelių pluginų klaidų taisymas.

Post by OriGinal »

Dėkui, padėjo. ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests