hii,
i am spawning an enitity using this code to any Origin
PHP Code:
public load_flags()
{
new szMapName[32]
get_mapname(szMapName, 31)
strtolower(szMapName)
formatex(g_szConfigFile, 127, "addons/amxmodx/configs/testing")
if( !dir_exists(g_szConfigFile))
{
mkdir(g_szConfigFile)
format(g_szConfigFile, 127, "%s/%s.txt", g_szConfigFile, szMapName )
return
}
format(g_szConfigFile, 127, "%s/%s.txt", g_szConfigFile, szMapName)
if(!file_exists(g_szConfigFile))
{
fopen(g_szConfigFile, "at")
return
}
new iFile = fopen( g_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(iFile, szData, charsmax(szData))
trim(szData)
if(!szData[0]) continue;
parse(szData, x, 15, y, 15, z, 15, szDesc, 31)
vOrigin[0] = str_to_float(x)
vOrigin[1] = str_to_float(y)
vOrigin[2] = str_to_float(z)
spawn_testing(vOrigin, szDesc)
}
fclose( iFile )
}
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 !!
__________________