i have the following code (Natural-Selection)
Code:
public pugin_init(){
register_logevent("createcc",1)
}
public createcc(){
new i
ccindex[0] = 0
ccindex[1] = 0
ccindex[2] = 0
ccindex[3] = 0
// code part a
for ( i = 1; i <= ns_get_build("team_command",1,0); i++){
ccindex[pev(ns_get_build("team_command",1,i),pev_team)] = ns_get_build("team_command",1,i)
}
if (!ccindex[2]){
remove_entity(ccindex[2])
}
// code part b
pev(ccindex[3],pev_origin,cclocation)
entity_set_origin(ccindex[3],cclocation)
new Float:temporigin[3]={9999.9,9999.9,9999.9}
entity_set_origin(ccindex[3],temporigin)
ccindex[2] = create_entity("team_command")
spawn(ccindex[2])
copy_pev(ccindex[3],ccindex[2])
set_pev(ccindex[2],pev_team,2)
entity_set_origin(ccindex[2],cclocation)
}
the problem is now that code part b is executed before code part a, but only when server loads (server start/mapchange plugin gets initialized)
than it works normal
why is it so?
__________________