View Single Post
Author Message
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 06-11-2020 , 03:35   choosing only "x" number of origin to spawn
Reply With Quote #1

hii,

i am spawning an enitity using this code to any Origin

PHP Code:
public load_flags()
{
    new 
szMapName[32]
    
get_mapname(szMapName31)
    
strtolower(szMapName)
    
    
formatex(g_szConfigFile127"addons/amxmodx/configs/testing")
    
    if( !
dir_exists(g_szConfigFile)) 
    {
        
mkdir(g_szConfigFile)
        
format(g_szConfigFile127"%s/%s.txt"g_szConfigFileszMapName )
        return
    }
    
    
format(g_szConfigFile127"%s/%s.txt"g_szConfigFileszMapName)
    if(!
file_exists(g_szConfigFile)) 
    {
        
fopen(g_szConfigFile"at")
        return
    }
    
    new 
iFile fopeng_szConfigFile"rt" )
    if(!
iFile) return
    
    new 
x[16], y[16], z[16], szDesc[32], szData[charsmax(x) + charsmax(y) + charsmax(z) + charsmax(szDesc)]
    
    new 
Float:vOrigin[3]
    
    while(!
feof(iFile)) 
    {
        
fgets(iFileszDatacharsmax(szData))
        
trim(szData)
        
        if(!
szData[0]) continue;
        
        
parse(szDatax15y15z15szDesc31)
        
        
vOrigin[0] = str_to_float(x)
        
vOrigin[1] = str_to_float(y)
        
vOrigin[2] = str_to_float(z)
        
        
spawn_testing(vOriginszDesc)
    }
    
    
fcloseiFile )

and this is my Spawn file (X Y Z coordinate)

Code:
323 -1007 67    
321 -1242 67
128 -2027 67 
224 -2214 67 
153 -1854 -60 
121 -236 67 
-419 357 51 
-100 1353 51 
534 1473 51 7
1478 659 435 7
let in this file there are 10 origins and what i wanted is to spawn my entitiy to only "n" origins (the "n" can be 6 origins from 10 origins, It can be Random) only

i don't wanna spawn my enitity to all 10 ORIGINS , it can choose any 6 random origins from 10 origins from file

THANKS IN ADVANCED !!
__________________
SED LYF !!!

Last edited by SHIELD755; 06-11-2020 at 08:45.
SHIELD755 is offline