Raised This Month: $ Target: $400
 0% 

What wrong??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
emperial159
Member
Join Date: Feb 2011
Old 04-28-2011 , 09:03   What wrong??
Reply With Quote #1

Code:
L 04/27/2011 - 16:21:45: [AMXX] Run time error 4: index out of bounds
What is wrong with this code???

PHP Code:
set_pev(randomplpev_gravitytank_gravity
Can somone help me?
emperial159 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-28-2011 , 09:26   Re: What wrong??
Reply With Quote #2

Nothing wrong. Error is not on this line.

Show the full error.
Show more code.
__________________
Arkshine is offline
emperial159
Member
Join Date: Feb 2011
Old 04-28-2011 , 09:44   Re: What wrong??
Reply With Quote #3

PHP Code:
public tank_reborn(iTaskID)
{
    if (
get_playersnum() < 1)
        return;

    
g_SpawnTanks &= ~( << ( ( iTaskID REBORN_TANK ) & 31 ) );

    new 
cName[32], randompliPlayers[32], iNum;

    
get_players(iPlayersiNum"ae""TERRORIST");
    
randompl iPlayers[random(iNum)];

    new 
Floattank_healthFloat:tank_gravity
    tank_health 
get_pcvar_float(hp_tank)
    
tank_gravity get_pcvar_float(gr_tank) / 800

    iClass
[randompl] = 9;
    
copy(player_model[randompl], charsmaxplayer_model[] ), tank_model)
    
set_pev(randomplpev_healthtank_health)
    
set_pev(randomplpev_gravitytank_gravity
Error sad on this line it's wrong where i wrote...

Code:
L 04/27/2011 - 16:21:45: [AMXX]    [0] uhhh.sma::global_tank (line 814)
L 04/27/2011 - 16:28:03: [AMXX] Displaying debug trace (plugin "uhhh.amxx")
L 04/27/2011 - 16:28:03: [AMXX] Run time error 4: index out of bounds

Last edited by emperial159; 04-28-2011 at 09:47.
emperial159 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-28-2011 , 18:25   Re: What wrong??
Reply With Quote #4

You need to show the whole error and what a line number is in the code. You currently have part of two different errors.

Attaching the full code will make things much easier.
__________________
fysiks is offline
emperial159
Member
Join Date: Feb 2011
Old 04-29-2011 , 09:23   Re: What wrong??
Reply With Quote #5

PHP Code:
 get_players(iPlayersiNum"ae""TERRORIST"); 
Sry guys now it's this line error...


PHP Code:
 public global_tank()
{
    if (
get_playersnum() < 1)
        return;

    new 
cName[32], randompliPlayers[32], iNum;

    
get_players(iPlayersiNum"ae""TERRORIST");
    
randompl iPlayers[random(iNum)];

    new 
Floattank_healthFloat:tank_gravity
    tank_health 
get_pcvar_float(hp_tank)
    
tank_gravity get_pcvar_float(gr_tank) / 800

    iClass
[randompl] = 9;
    
copy(player_model[randompl], charsmaxplayer_model[] ), tank_model)
    
set_pev(randomplpev_healthtank_health)
    
set_pev(randomplpev_gravitytank_gravity)
    
bacon_give_weapon(randompl"weapon_knife")
    
set_pev(randomplpev_viewmodel2zombie_hands)
    
set_pev(randomplpev_weaponmodel2"")

    new 
currentmodel[32];
    
fm_get_user_model(randomplcurrentmodelsizeof currentmodel 1);
        
    if(!
equal(currentmodelplayer_model[randompl]))
    {
    
set_task(0.2"Task_Model"randompl TASKID_MODEL)
    }

    
get_user_name(randomplcName31);
    
set_hudmessage(150000.020.3000.02.02.01.0, -1);
    
show_hudmessage(0"Tank %s just spawned!!!"cName);

emperial159 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-29-2011 , 19:05   Re: What wrong??
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
You need to show the whole error
from your error logs.

Quote:
Originally Posted by emperial159 View Post
PHP Code:
 get_players(iPlayersiNum"ae""TERRORIST"); 
Sry guys now it's this line error...
There is no error on that line.
__________________
fysiks is offline
Old 04-29-2011, 20:19
ProIcons
This message has been deleted by ProIcons.
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 04-29-2011 , 20:37   Re: What wrong??
Reply With Quote #7

iClass[randompl]

Provide us iClass array's max characters
also change iPlayers[32] to iPlayers[33] just to be sure for this: randompl = iPlayers[random(iNum)];
also provide us the player_model[]'s max characters

also just to be sure again replace

Code:
fm_get_user_model(randompl, currentmodel, sizeof currentmodel - 1);
to
Code:
fm_get_user_model(randompl, currentmodel, charsmax( currentmodel ));
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
emperial159
Member
Join Date: Feb 2011
Old 04-30-2011 , 02:18   Re: What wrong??
Reply With Quote #8

PHP Code:
iClass[randompl] = 9
PHP Code:
    new randompliPlayers[32], iNum
when i do 33 error in compile sad array size do not match, or destination array is too small.

PHP Code:
new player_model[33][32
here...

With your code is okey ,but stilll error...

Any idea?
emperial159 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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