Archived copy of warcraft-source.com, the Warcraft: Source (WCS) forum (2007–2011), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2008-12-05 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
December 05, 2008, 01:05:27 PM *
Welcome, Guest. Please login or register.
Login with username, password and session length
News: Remember to check on the FAQ before start posting.
It may save you time and effort.
Also here is the WCS Wiki!
Google  
  Home   Forum   Help Search Login Register   *
Pages: [1]   Go Down
  Print  
Current Topic Rating: ***** You have not rated this topic. Select a rating:
Author Topic: Feeding Ability  (Read 208 times)
freddukes
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United Kingdom

Posts: 265



« on: December 30, 2007, 03:49:43 PM »

This code should be coded into the ./addons/eventscripts/wcs/WCSfunctions/es_WCSfunctions.txt. It allows the user to stand over dead bodies, and gain health every second, dependant on how much you tell them to get.

The command you put in your race would be

es wcs_feed <userid> <health per second> <max health to regen to>

an example would be

event player_spawn
{
  es wcs_feed event_var(userid) 3 150
}

This would allow the player (from the start of the round) to go stand over any body he wish and gain 3 health per second, until his health reached  150.

Try it out (note this is untested, though I can't see why it shan't work.)

Code
GeSHi (eventscripts):
// copy all of this inside es_WCSfunctions.txt
 
block load
{
 es_exists ex command wcs_feed
 if (server_var(ex) = 0) then es_xregcmd wcs_feed wcs/WCSfunctions/wcs_feedbegin "wcs_feed - usage: es wcs_feed <userid> <health per second> <max health>"
 repeat create feed_check "es_xdoblock wcs/WCSfunctions/foreach_players"
}
 
event player_death
{
 es_getplayerlocation wcs_x wcs_y wcs_z event_var(userid)
 es_xmath wcs_z + 64
 es_createvectorstring wcs_location_t server_var(wcs_x) server_var(wcs_y) server_var(wcs_z)
 es_keycreate wcs_locations server_var(wcs_location_t)
}
 
event round_start
{
 repeat start feed_check
 es_xkeygroupcreate wcs_locations
 es_xkeygroupcreate wcs_feeding
}
 
event round_end
{
 repeat stop feed_check
 es_xkeygroupdelete wcs_locations
 es_xkeygroupdelete wcs_feeding
}
 
block wcs_feedbegin
{
 es_xgetargv wcs_uid 1
 es_keycreate wcs_feeding server_var(wcs_uid)
 es_xgetargv wcs_health 2
 es_keysetvalue wcs_feeding server_var(wcs_uid) healthps server_var(wcs_health)
 es_xgetargv wcs_health 3
 es_keysetvalue wcs_feeding server_var(wcs_uid) maxhealth server_var(wcs_health)
}
 
block foreach_players
{
 es_xforeachkey wcs_uid in wcs_feeding "es_xdoblock wcs/WCsfunctions/check_location"
}
 
block check_location
{
 es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 server_var(wcs_uid)
 es_xforeachkey wcs_location_t in wcs_locations "es_xdoblock wcs/WCSfunctions/compare_locations"
}
 
block compare_locations
{
 es_splitvectorstring wcs_x wcs_y wcs_z server_var(wcs_location_t)
 es_xmathparse wcs_z "wcs_z1 - wcs_z"
 es_xmathparse wcs_y "wcs_y1 - wcs_y"
 es_xmathparse wcs_x "wcs_x1 - wcs_x"
 ifx parse("wcs_x > -101 and wcs_x < 101") do
 {
   ifx parse("wcs_y > -101 and wcs_y < 101") do
   {
     ifx parse("wcs_z > -301 and wcs_z < 301") do
     {
       es_getplayerprop wcs_health server_var(wcs_uid) "CBasePlayer.m_iHealth"
       es_keygetvalue wcs_regenerate wcs_feeding server_var(wcs_uid) healthps
       es_xmathparse wcs_health "health_temp + wcs_regenerate"
       es_keygetvalue wcs_tmp wcs_feeding server_var(wcs_uid) maxhealth
       if (server_var(wcs_health) <= server_var(wcs_tmp)) do
       {
         es_setplayerprop server_var(wcs_uid) "CBasePlayer.m_iHealth" server_var(wcs_health)
       }
       else do
       {
         es_setplayerprop server_var(wcs_uid) "CBasePlayer.m_iHealth" server_var(wcs_tmp)
       }
     }
   }
 }
}
 
block unload
{
 repeat stop feed_check
 es_xkeygroupdelete wcs_locations
 es_xkeygroupdelete wcs_feeding
}
 

an example of using this in a real code is...

Code:
    "skill5_setting"    "es_xset wcs_health 1|es_xset wcs_health 2|es_xset wcs_health 3|es_xset wcs_health 4"
    "skill5_cmd"    "es wcs_feed event_var(userid) server_var(wcs_health) 100"

Currently this will not support an effect, however I could make it support if this is popular I'll make it support effects...

-freddukes
Logged

c6464
Guest
« Reply #1 on: December 30, 2007, 04:10:56 PM »

wow cool! Make more cool features!!
Logged
::wavez::
Level 2 Apprentice
**
Offline Offline

United States United States

Posts: 55


We need some flaming homeless people flying around


WWW
::two Kings:: wavez
« Reply #2 on: December 31, 2007, 04:49:01 AM »

Thats not bad at all, Blob.  Not bad.  Awesome idea.
Logged

Angelღ
Level 7 Expert
*****
Offline Offline

United States United States

Posts: 334



WWW
1101101
younggunelite
« Reply #3 on: December 31, 2007, 06:43:14 AM »

could use for a vampire race even better dead races nice work still havent used it going to tho.
Logged

"Death is just the first step"

~AJ
karcass
Level 1 Trained Beginner
*
Offline Offline

United Kingdom

Posts: 24



« Reply #4 on: January 05, 2008, 03:32:31 AM »

i couldnt get this to work i tried it as an ultimate, when the ulitmate button was pressed the screen went lighter for a second as if it worked but it didnt add any health so i gave up lolz i was quite drunk at the time haha!!!! 
Logged

Frodo
WCS ESP Dev Team
Level 7 Expert

Offline Offline

Posts: 846


Actinosphaerium eichhorni


WWW
ckenduro
aulix
« Reply #5 on: January 05, 2008, 04:53:38 PM »

This will work, however, it will work not exactly as fred wants.

What if someone got hit by a nade, then his body makes a fly and is somewhere else? You will be able to feed over GROUND...

However, there is a way, I think. Try messing up with properties, ent_fire and entity cs_ragdoll.
Logged


Actually I found it as best Bux ever. Everything's automated!
c6464
Guest
« Reply #6 on: January 05, 2008, 06:15:33 PM »

es_getDeadPlayerCorpse x_1 y_1 z_1
Logged
Frodo
WCS ESP Dev Team
Level 7 Expert

Offline Offline

Posts: 846


Actinosphaerium eichhorni


WWW
ckenduro
aulix
« Reply #7 on: January 05, 2008, 06:23:41 PM »

No such command, mate.
Logged


Actually I found it as best Bux ever. Everything's automated!
Pages: [1]   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
December 04, 2008, 09:57:56 PM
gg
December 04, 2008, 09:46:16 PM
hey guys, how are you?
gonna sleep, cya tomorrow
December 03, 2008, 12:45:48 PM
@ bombkill : all mods should be compatible with WCS... but we can't be sure
@retrokboy : css server? provider? other mods?
December 03, 2008, 01:49:25 AM
I NEED SERVER HELP MY FORUM IS IN BUG REPORT PLEASE REPLY I NEED HALP
December 02, 2008, 10:05:01 PM
does anyone know where all the wcs compatible mods are listed or a website i can find them
December 02, 2008, 08:24:47 PM
/agree
Recent
[Today at 12:14:07 PM]

[Today at 10:58:16 AM]

[Today at 09:15:22 AM]

[Today at 04:51:59 AM]

[Today at 04:11:23 AM]

[Today at 04:04:32 AM]

[Today at 04:02:29 AM]

[Today at 03:33:23 AM]

[Today at 01:07:24 AM]

[December 04, 2008, 10:55:49 PM]
Theme switch

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.127 seconds with 27 queries.