AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] What is this error? (https://forums.alliedmods.net/showthread.php?t=233327)

wTf. 01-13-2014 03:28

[SOLVED] What is this error?
 
Code:

L 01/13/2014 - 10:25:27: [AMXX] Displaying debug trace (plugin "GoBackBase.amxx")
L 01/13/2014 - 10:25:27: [AMXX] Run time error 4: index out of bounds
L 01/13/2014 - 10:25:27: [AMXX]    [0] GoBackBase.sma::fwd_spawn (line 40)
L 01/13/2014 - 10:25:27: [AMXX] Displaying debug trace (plugin "GoBackBase.amxx")
L 01/13/2014 - 10:25:27: [AMXX] Run time error 4: index out of bounds
L 01/13/2014 - 10:25:27: [AMXX]    [0] GoBackBase.sma::fwd_spawn (line 40)

PHP Code:

public fwd_spawnid )
{
    if(!
is_user_alive(id)) return;

    
has_usedid ] = 0;
        
    
PlayerOrigin][ id ] = 0.0;
    
PlayerOrigin][ id ] = 0.0;
    
PlayerOrigin][ id ] = 0.0;
    
entity_get_vectoridEV_VEC_originPlayerOriginid ] );



DavidJr 01-13-2014 03:31

Re: What is this error?
 
considering with global variable:
PHP Code:

new FloatPlayerOrigin33 ][ ]; 

with you put in spawn forward:
PHP Code:

 PlayerOriginid ][ ] = 0.0
    
PlayerOriginid ][ ] = 0.0
    
PlayerOriginid ][ ] = 0.0

it should be
PHP Code:

 PlayerOrigin][ id ] = 0.0
    
PlayerOrigin][ id ] = 0.0
    
PlayerOrigin][ id ] = 0.0


wTf. 01-13-2014 03:41

Re: What is this error?
 
Ohh thank you i didn't see :)

ConnorMcLeod 01-13-2014 23:29

Re: [SOLVED] What is this error?
 
PHP Code:

//    PlayerOrigin[ id ][ 0 ] = 0.0;
//    PlayerOrigin[ id ][ 1 ] = 0.0;
//    PlayerOrigin[ id ][ 2 ] = 0.0;
    
entity_get_vectoridEV_VEC_originPlayerOriginid ] ); 

Also, commented lines are useless, those 3 cells gonna be filled with EV_VEC_origin in any way.


But there is something i'm wondering, why are you doing this ?
I mean, to put a player back in base, just do ExecuteHam(Ham_Spawn, id) on him :

PHP Code:

spawn_player_back(id)
{
    new 
Float:flHealth entity_get_float(idEV_FL_health);
    
ExecuteHam(Ham_Spawnid);
    
entity_set_float(idEV_FL_healthflHealth);




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

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