AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Include error (https://forums.alliedmods.net/showthread.php?t=155110)

bibu 04-17-2011 15:35

Include error
 
Can someone help me with this include please? I already asked in the topic but I am sure that the author will not respond within the next days.

Inc:

http://forums.alliedmods.net/attachm...9&d=1279216152

Error:

Quote:

L 04/17/2011 - 17:58:13: [AMXX] Run time error 10: native error (native "ArraySize")
L 04/17/2011 - 17:58:13: [AMXX] [0] superspawns.inc::SsGetOrigin (line 52)
L 04/17/2011 - 17:58:13: Invalid array handle provided

Arkshine 04-17-2011 16:18

Re: Include error
 
And your code is ?

bibu 04-17-2011 17:03

Re: Include error
 
PHP Code:

        new Float:fRandom[3]
        new 
Float:fBelow[3]
        new 
Trace_Result
        
        
while(SsGetOrigin(fRandom))
        {
            
xs_vec_copy(fRandomfBelow)
            
fBelow[2] -= 100.0 // i believe the height of a player is 27, let me know if i'm mistaken
            
engfunc(EngFunc_TraceLinefRandomfBelowIGNORE_MONSTERS0Trace_Result)
            
            if(
get_tr2(Trace_ResultTR_pHit) == 0// want it so you spawn above a floor
            
{
                
set_pev(idpev_originfRandom)
                
                break
            }
        } 


Arkshine 04-17-2011 17:20

Re: Include error
 
I was right, this error could be only because Arrays were not created.
You seem having problem to read stuffs because all is well written clearly you have to call SsInit() before.
Quote:

// First we have to initialize the arrays and parameters
// The value 3500.0 is the minimum distance between points
// Nearest points will be found, but GetOrigin will erase points
// with less than 3500.0 distance with other used points and return
SsInit(3500.0)

bibu 04-17-2011 17:28

Re: Include error
 
http://forums.alliedmods.net/showthr...ht=SsGetOrigin

Arkshine 04-17-2011 17:36

Re: Include error
 
At the end, it's the same, you have not tried to understand, nor to read the tutorial to see if the code was missing something.

bibu 04-17-2011 17:40

Re: Include error
 
Well still it doesn't teleport me to a random spawnpoint. No errors this time. It does teleport it specific to the standard spawnpoints.

Arkshine 04-17-2011 17:45

Re: Include error
 
Your current plugin is ?

bibu 04-18-2011 11:42

Re: Include error
 
Quote:

Originally Posted by Arkshine (Post 1452376)
Your current plugin is ?

In init:

PHP Code:

    SsInit(3500.0)
    
SsScan() 

Code still the one from the first post.

Arkshine 04-18-2011 14:51

Re: Include error
 
Try to use just that, instead of the whole while :

if( SsGetOrigin( fRandom ) )
{
engfunc( EngFunc_SetOrigin, id, fRandom );
}


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

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