AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [help] Error (https://forums.alliedmods.net/showthread.php?t=320281)

popilas 12-13-2019 08:58

[help] Error
 
Hello, got some problems

PHP Code:

[AMXXDisplaying debug trace (plugin "supply_box.amxx"version "2.0")
[
AMXXRun time error 10native error (native "ArrayGetArray")
[
AMXX]    [0supply_box.sma::supply_box_pickup (line 389

Line 389

PHP Code:

    ArrayGetArray(SupplyBoxesContentsrandomDropData); 


Then take box got this error

the box remains on the ground i cant take it and go this error.

OciXCrom 12-13-2019 09:13

Re: [help] Error
 
Show the code for all relevant variables.

popilas 12-13-2019 09:16

Re: [help] Error
 
Quote:

Originally Posted by OciXCrom (Post 2676816)
Show the code for all relevant variables.

PHP Code:

new Array:SupplyBoxes, Array:EmptyCfgLines// <- Information holders //

enum _:SupplyBoxesArray 
{   // <- Array variables //
    
line_id,
    
Float:box_origin[3],
    
Float:box_angles[3]
}

new Array:
SupplyBoxesContents// <- Content holder //

enum _:SupplyContentsArray 
{
    
box_id,
    
box_name[35],
    
pickupForwardItem 


redivcram 12-13-2019 09:41

Re: [help] Error
 
And what did you do with them?

popilas 12-13-2019 09:53

Re: [help] Error
 
Quote:

Originally Posted by redivcram (Post 2676820)
And what did you do with them?

just wanna fix error I can take it
Now i cant take it.

DjSoftero 12-13-2019 13:50

Re: [help] Error
 
not enough code. Show how the "randomDrop" and "data" works

popilas 12-13-2019 15:24

Re: [help] Error
 
Quote:

Originally Posted by DjSoftero (Post 2676841)
not enough code. Show how the "randomDrop" and "data" works

public supply_box_pickup(box, player)
{
if(!is_user_alive(player) || !can_pickup[player])
return;

new randomDrop = random(ArraySize(SupplyBoxesContents));
new Data[SupplyContentsArray];

ArrayGetArray(SupplyBoxesContents, randomDrop, Data);
ExecuteForward(Data[pickupForwardItem], forwardResult, player);

if(get_pcvar_num(cvar_pickupTimes) > 0)



new Data[SupplyContentsArray];
Data[box_id] = ArraySize(SupplyBoxesContents);
Data[box_name] = BoxName;
Data[pickupForwardItem] = CreateOneForward(plugin_id, "sb_pickup_event", FP_CELL);


I can pm all code

Natsheh 12-14-2019 05:12

Re: [help] Error
 
Show the full error log.

Error possiblity either the array is invalid (SupplyBoxesContents) or the it's the item (randomDrop) or could be both.

popilas 12-14-2019 07:19

Re: [help] Error
 
Quote:

Originally Posted by Natsheh (Post 2676908)
Show the full error log.

Error possiblity either the array is invalid (SupplyBoxesContents) or the it's the item (randomDrop) or could be both.

its full error code
[AMXX] Displaying debug trace (plugin "supply_box.amxx", version "2.0")
[AMXX] Run time error 10: native error (native "ArrayGetArray")
[AMXX] [0] supply_box.sma::supply_box_pickup (line 389)

OciXCrom 12-14-2019 07:36

Re: [help] Error
 
Did you create the array with ArrayCreate() before using ArrayGetArray() on it? Show the creation code.
Do the array contents that are stored inside match with the ones you're retrieving from it?


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

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