Raised This Month: $ Target: $400
 0% 

Solved Invalid cellvector handle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-23-2018 , 15:08   Re: Invalid cellvector handle
Reply With Quote #1

Nvm, you are right, keep doing what you were doing. All good
__________________
stuff
maqi is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-23-2018 , 15:12   Re: Invalid cellvector handle
Reply With Quote #2

What is even the point of using another array instead of using directly SsGetOrigin?
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-23-2018 , 15:16   Re: Invalid cellvector handle
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
What is even the point of using another array instead of using directly SsGetOrigin?
Randomized origins.
__________________
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-23-2018 , 15:36   Re: Invalid cellvector handle
Reply With Quote #4

You can edit superspawn so it does't delete the entry in the array after it is used.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-23-2018 , 17:53   Re: Invalid cellvector handle
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
You can edit superspawn so it does't delete the entry in the array after it is used.
Yeah but if you keep using SsGetOrigin it will eventually run out of origins, right?
So I might need to add these origins that I retrieve in an .ini file for later use. Also I don't really wanna edit superspawns source because I might mess up something.

Quote:
Originally Posted by EFFx View Post
I meant using everytime same spawn points... Not actually the same. But as I said, sometime the code will be out of points and you must restart, which causes lag.
__________________

Last edited by edon1337; 07-23-2018 at 17:55.
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-24-2018 , 03:24   Re: Invalid cellvector handle
Reply With Quote #6

What I'm saying is to remove ArrayDeleteItem from the source, this way it will not run out of points anymore. When you used the last origin start again from the first one.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-24-2018 , 06:24   Re: Invalid cellvector handle
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
What I'm saying is to remove ArrayDeleteItem from the source, this way it will not run out of points anymore. When you used the last origin start again from the first one.
This is why I don't like touching other people's code, it's confusing when you're not the one who wrote it.

Would setting the size to 0 make it start over from first one?
PHP Code:
stock SsGetOrigin(Float:origin[3])
{
    new 
Float:data[3], size
    
new ok 1

    
while((size ArraySize(g_vecSsOrigins)))
    {
        new 
idx random_num(0size 1)

        
ArrayGetArray(g_vecSsOriginsidxorigin)

        new 
used ArraySize(g_vecSsUsed)
        for(new 
0usedi++)
        {
            
ok 0
            ArrayGetArray
(g_vecSsUsedidata)
            if(
get_distance_f(dataorigin) >= g_flSsMinDist)
            {
                
ok 1
                
break
            }
        }

        if(
ok)
        {
            
ArrayPushArray(g_vecSsUsedorigin)
            return 
true
        
}
    }
    
size=0;
    return 
false

__________________

Last edited by edon1337; 07-24-2018 at 06:33.
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-24-2018 , 06:52   Re: Invalid cellvector handle
Reply With Quote #8

Quote:
Originally Posted by edon1337 View Post
This is why I don't like touching other people's code, it's confusing when you're not the one who wrote it.

Would setting the size to 0 make it start over from first one?
PHP Code:
stock SsGetOrigin(Float:origin[3])
{
    new 
Float:data[3], size
    
new ok 1

    
while((size ArraySize(g_vecSsOrigins)))
    {
        new 
idx random_num(0size 1)

        
ArrayGetArray(g_vecSsOriginsidxorigin)

        new 
used ArraySize(g_vecSsUsed)
        for(new 
0usedi++)
        {
            
ok 0
            ArrayGetArray
(g_vecSsUsedidata)
            if(
get_distance_f(dataorigin) >= g_flSsMinDist)
            {
                
ok 1
                
break
            }
        }

        if(
ok)
        {
            
ArrayPushArray(g_vecSsUsedorigin)
            return 
true
        
}
    }
    
size=0;
    return 
false

Setting the size to 0 at the end of the stock its useless wont effect anything


Also random_num(0, size - 1) = random(size) if size is greater than 0.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-24-2018 at 06:54.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-24-2018 , 08:09   Re: Invalid cellvector handle
Reply With Quote #9

You have a talent of always doing anything else except what was suggested.
The change that I proposed was very minimal, so you don't have to edit a lot of code you don't understand.
__________________

Last edited by HamletEagle; 07-24-2018 at 08:09.
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-24-2018 , 08:30   Re: Invalid cellvector handle
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
You have a talent of always doing anything else except what was suggested.
What? Basically the while loop is there to loop from 0 to array size, so when the while() loop has ended, it means the last origin has been used, how is this un-related to what you said?
__________________
edon1337 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 12:38.


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