Code:
new iEnt = create_entity("info_gameplay")
DispatchKeyValue(iEnt,"classname","info_gameplay")
new value[1] = 100
new origin[32]
server_print("%d",value)
if(!is_valid_ent(iEnt)){
server_print("Invalid Ent")
return PLUGIN_HANDLED
}
get_keyvalue(iEnt, "teamone", value, 1)
if((value[0] <= Spectator) || (value[0] >= Unknown)){
client_print(id,print_chat,"Undefined Error")
get_keyvalue(iEnt, "teamone", value, 1)
server_print("%i",value)
get_keyvalue(iEnt, "teamtwo", value, 1)
server_print("%i",value)
new Teamchange[0] = 1
DispatchKeyValue(iEnt,"teamtwo",Teamchange)
server_print("%i",Teamchange)
DispatchKeyValue(iEnt,"teamone",Teamchange)
DispatchKeyValue(entity,"origin","8192 8192 8192")
server_print("%i",Teamchange)
DispatchSpawn(iEnt)
get_keyvalue(iEnt, "teamone", value, 1)
server_print("%i",value)
get_keyvalue(iEnt, "teamtwo", value, 1)
get_keyvalue(iEnt, "origin",origin,31)
server_print("%d",origin)
entity_set_string(iEnt, EV_SZ_classname, "info_gameplay")
server_print("%i",value)
server_print("End")
return PLUGIN_CONTINUE
}
If you look its like a before and after. I get the values of teamone and teamtwo after the ent was initiated, then I use DispatchKeyValue() to change around the properties, spawn it, then I get the values again. Only problem is its still returns zero when it should return 1.