Im pretty new at this entity stuff, I have managed to get some stuff working, but am having trouble here
Code:
@PointClass base(Target) size(-16 -16 -36, 16 16 36) color(255 125 0) = ts_powerup : "TS powerup"
[
pwuptype(choices) : "Powerup Type" : 0 =
[
0: "Random"
1: "Slow Motion"
2: "Infinite Clip"
4: "Kung Fu"
8: "Slow Pause"
16: "Double Firerate"
32: "Grenade"
64: "Health"
128: "Armor"
256: "Low Gravity"
]
pwupduration(integer) : "Respawn time" : 60
message(string) : "Message when pick up"
]
From the FDG of the ent I want to make
Now, here is my code to spawn the ent I want, most of it was from AssKickR
Code:
public create_powerup(id) {
/*Made by AssKicR.. CopyLeft 2004->Eternity*/
client_print(id,print_chat,"You have tried to spawn a powerup")
new ent = create_entity("ts_powerup")
DispatchKeyValue(ent, "pwuptype", "256")
// DispatchKeyValue(ent, "pwuptype", 256) // invalid argument type, cant use int... wtf
DispatchSpawn(ent)
new Float:fNewOrigin[3]
entity_get_vector(id, EV_VEC_origin, fNewOrigin)
entity_set_origin(ent, fNewOrigin)
fake_touch(id,ent)
fake_touch(ent,id)
remove_entity(ent)
return PLUGIN_HANDLED
}
__________________