Raised This Month: $ Target: $400
 0% 

Entity spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LynX
Veteran Member
Join Date: Oct 2004
Old 10-19-2004 , 09:20   Entity spawn
Reply With Quote #1

I'm almost finished with mine plugin, but say, how do you spawn an entity, and give that entity a model? Entity should be pickable, and when player pick it, player should die (I assume that player should die with kill native).
LynX is offline
Send a message via ICQ to LynX
Votorx
Senior Member
Join Date: Jun 2004
Old 10-20-2004 , 07:06  
Reply With Quote #2

Look at the engine include file and try to figure it out
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-23-2004 , 00:07  
Reply With Quote #3

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
XxAvalanchexX is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode