AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error in code Need Help (https://forums.alliedmods.net/showthread.php?t=229411)

asdfdsdf 11-07-2013 08:12

Error in code Need Help
 
I have a few errors but i dont know whats wrong can someone help me with this here are errors and codes


Errors;
PHP Code:

[AMXXDisplaying debug trace (plugin "Jailbreak_Lastrequest.amxx")
L 11/07/2013 13:54:14: [AMXXRun time error 4index out of bounds 
L 11
/07/2013 13:54:14: [AMXX]    [0colorchat.inc::ColorChat (line 80)
L 11/07/2013 13:54:14: [AMXX]    [1Jailbreak_Lastrequest.sma::Handler_PlayerList (line 421)
L 11/07/2013 13:54:25: [AMXXDisplaying debug trace (plugin "Jailbreak_Lastrequest.amxx")
L 11/07/2013 13:54:25: [AMXXRun time error 4index out of bounds 
L 11
/07/2013 13:54:25: [AMXX]    [0colorchat.inc::ColorChat (line 80)
L 11/07/2013 13:54:25: [AMXX]    [1Jailbreak_Lastrequest.sma::EventSpray (line 648)
L 11/07/2013 13:54:29: [AMXXDisplaying debug trace (plugin "Jailbreak_Lastrequest.amxx")
L 11/07/2013 13:54:29: [AMXXRun time error 4index out of bounds 
L 11
/07/2013 13:54:29: [AMXX]    [0colorchat.inc::ColorChat (line 80)
L 11/07/2013 13:54:29: [AMXX]    [1Jailbreak_Lastrequest.sma::EventSpray (line 648)
L 11/07/2013 13:54:42: [AMXXDisplaying debug trace (plugin "Jailbreak_Lastrequest.amxx")
L 11/07/2013 13:54:42: [AMXXRun time error 4index out of bounds 
L 11
/07/2013 13:54:42: [AMXX]    [0colorchat.inc::ColorChat (line 80)
L 11/07/2013 13:54:42: [AMXX]    [1Jailbreak_Lastrequest.sma::Ham_PlayerKilled (line 248



PHP Code:

[public Ham_PlayerKilled(idiAttackerhmm) {
    if((
id == Players[0] || id == Players[1])) {
        new 
szName[2][32]
        
get_user_name((id == Players[0]) ? Players[1] : Players[0], szName[0], 31)
        
get_user_name((id == Players[0]) ? Players[0] : Players[1], szName[1], 31)
        
        new 
plrid = (id == Players[0]) ? Players[1] : Players[0]
        
        
ColorChat(0GREY"^x04%s^x03 %s^x01 won the^x03 %s^x01 vs^x03 %s^x01."TAGszName[0], Lr_Names[LrType], szName[1])
        
        if( 
ac_get_player_statusplrid ) == LOADED && !ac_hasplridg_iAcTheProfessional ) )
        {
            if( 
ac_set_valueplridg_iAcTheProfessionalINCREASE) >= 50 )
            {
                
ac_giveplridg_iAcTheProfessional )
                
                
jbshop_set_cashplridjbshop_get_cashplrid ) + 5000 )
            }
        }
        
        
jbshop_set_cash((id == Players[0]) ? Players[1] : Players[0], (jbshop_get_cash((id == Players[0]) ? Players[1] : Players[0]) + 250))
        
        
LastRequest_Stop()
    }


PHP Code:

public EventSpray( ) {
    if(
Running && LrType == Spray) {
        new 
iOrigin];
        
iOrigin] = read_data);
        
iOrigin] = read_data);
        
iOrigin] = read_data);
        
        new 
Float:vecSprayOrigin];
        
IVecFVeciOriginvecSprayOrigin );
        
        new 
iPlayer read_data);
        if(
iPlayer != Players[0] && iPlayer != Players[1])
            return 
PLUGIN_CONTINUE
        
        
new Float:vecPlayerOrigin];
        
get_user_originiPlayeriOrigin);
        
IVecFVeciOriginvecPlayerOrigin );
        
        new 
Float:vecDirection];
        
xs_vec_subvecSprayOriginvecPlayerOriginvecDirection );
        
        
xs_vec_mul_scalarvecDirection10.0 vector_lengthvecDirection ), vecDirection );
        
        new 
Float:vecStop];
        
xs_vec_addvecSprayOriginvecDirectionvecStop );
        
xs_vec_mul_scalarvecDirection, -1.0vecDirection );
        
        new 
Float:vecStart];
        
xs_vec_addvecSprayOriginvecDirectionvecStart );
        
        
engfuncEngFunc_TraceLinevecStartvecStopIGNORE_MONSTERS, -1);
        
        
get_tr20TR_vecPlaneNormalvecDirection );
        
        
vecDirection] = 0.0;
        
        
xs_vec_mul_scalarvecDirection5.0 vector_lengthvecDirection ), vecDirection );
        
xs_vec_addvecSprayOriginvecDirectionvecStart );
        
xs_vec_copyvecStartvecStop );
        
vecStop] -= 9999.0;
        
        
engfuncEngFunc_TraceLinevecStartvecStopIGNORE_MONSTERS, -1);
        
        
get_tr20TR_vecEndPosvecStop );
    
        new 
szName32 ]; get_user_nameiPlayerszNamecharsmaxszName ) );
        
        
SprayDistance[iPlayer] = ( vecStart] - vecStop] );
        
ColorChat(0GREY"^x04%s^x03 %s^x01:^x03 %s^x01 sprayed^x03 %f^x01 units."TAGLr_Names[LrType], szNameSprayDistance[iPlayer])
        
        if(
SprayDistance[Players[0]] != 0.0 && SprayDistance[Players[1]] != 0.0) {
            if(
SprayDistance[Players[0]] == SprayDistance[Players[1]]) {
                
ColorChat(0GREY"^x04%s^x03 %s^x01: Tie! Spray again."TAGLr_Names[LrType])
                
SprayDistance[Players[0]] = 0.0;
                
SprayDistance[Players[1]] = 0.0;
            }
            else {
                new 
Playerz = (SprayDistance[Players[0]] > SprayDistance[Players[1]]) ? Players[0] : Players[1]
                
get_user_namePlayerzszNamecharsmaxszName ) );
                
ColorChat(0GREY"^x04%s^x03 %s^x01 sprayed the highest (^x03 %f^x01)!"TAGszNameSprayDistance[Playerz])
            }
        }
    }
    return 
PLUGIN_CONTINUE;    



devilicioux 11-07-2013 08:36

Re: Error in code Need Help
 
Show your ColorChat Stock..

^SmileY 11-07-2013 08:57

Re: Error in code Need Help
 
check this: Lr_Names[LrType]

asdfdsdf 11-07-2013 13:08

Re: Error in code Need Help
 
@devilicioux
what do you mean

@^SmileY
huh man im noob in coding can you maybe give some more info xD

^SmileY 11-07-2013 19:27

Re: Error in code Need Help
 
Quote:

Originally Posted by asdfdsdf (Post 2057987)
@devilicioux
what do you mean

@^SmileY
huh man im noob in coding can you maybe give some more info xD

So, post full code

ironskillz1 11-08-2013 01:59

Re: Error in code Need Help
 
Quote:

Originally Posted by ^SmileY (Post 2058108)
So, post full code

He doesnt need to post the full code
Just download chatcolor.inc and colorchat.amxx
And use chatcolor.inc insted of colorchat.inc when you compile
And out colorchat.amxx in plugin

asdfdsdf 11-08-2013 04:51

Re: Error in code Need Help
 
Quote:

Originally Posted by ironskillz1 (Post 2058197)
He doesnt need to post the full code
Just download chatcolor.inc and colorchat.amxx
And use chatcolor.inc insted of colorchat.inc when you compile
And out colorchat.amxx in plugin


Thx mate didnt know that i compiled it now with chatcolor


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

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