Put this wherever you want to create the entity.
Code:
new deathent = create_entity("info_target");
entity_set_string(deathent,EV_SZ_classname,"deathent"); // give it custom name
entity_set_model(deathent,"models/yourmodelhere.mdl"); // don't forget to precache it
entity_set_origin(deathent,ORIGINHERE); // figure it out however
Put this just somewhere in your code, this is what kills the player when he picks it up.
Code:
// Entity collision
public pfn_touch(ptr,ptd) {
// Make sure one of the entities is a player
if(ptr < 1 || ptd < 1 || ptd > 32 || !is_user_alive(ptd) || !is_user_connected(ptd)) {
return PLUGIN_CONTINUE;
}
// Get classname
new classname[33];
entity_get_string(ptr,EV_SZ_classname,classname,32);
// See if it is our custom entity
if(equal(classname,"deathent") == 1) {
set_user_health(ptd,0); // kill user
client_print(ptd,print_chat,"* You've picked up the death entity!");
remove_entity(ptr); // remove death entity
return PLUGIN_CONTINUE;
}
return PLUGIN_CONTINUE;
}
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS