Raised This Month: $ Target: $400
 0% 

Stupid question...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
smdobay
Member
Join Date: Feb 2005
Old 03-04-2005 , 17:55   Stupid question...
Reply With Quote #1

I'm sure this has been asked before, but I couldn't find it.

I'm making an ns plugin where aliens can (voluntarily) devour each other to gain health. The eating thing works nicely, with one exception.

I need a player to be able to type "devour" into the console, which changes a flag or client side cvar or some other variable to "1", and then the next alien to touch them eats them.

How do I store this value saying "I can be eaten"?

Here's what I have so far:

Code:
public plugin_init() {     register_plugin("amxxNsPlugin","0.5","smdobay")     register_concmd("sacrifice","prep_sacrifice")     register_touch("player", "player", "devour_other")     register_cvar("sv_devour","1",FCVAR_SERVER|FCVAR_SPONLY) } public prep_sacrifice(id){     } public devour_other(id,cid){     if (get_cvar_num("sv_devour") == 1){                 new youName[32]         new otherName[32]                 get_user_name(id,youName,31)         get_user_name(cid,otherName,31)                 new youHealth = get_user_health(id)         new otherHealth = get_user_health(cid)                 if (otherHealth < 0){             otherHealth = 0         }             set_user_health(id,youHealth + otherHealth)                 user_silentkill(cid)                 new msgStr[31]         format(msgStr,30, "You just consumed %s.", otherName)         client_print(id,print_chat,msgStr)         format(msgStr,30, "You were just consumed by %s.", youName)         client_print(cid,print_chat,msgStr)     } }
smdobay is offline
 



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 14:12.


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