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 2011-09-18 (original capture). Home · Forum · All archived topics · Downloads

Author Topic: [Addon] Killstreaks - Python (Basic ES Experience Required)  (Read 371 times)

Offline Predz

  • Level 6 Experienced
  • *****
  • Posts: 120
  • Country:
  • Adding New Addons for Eventscripts.
Python - Killstreaks


PS: Thank MiB for the final Script in Python.

This new version of Killstreaks can be used in conjunction with the standard Counter Strike:Source Servers, and will soon be updated to support DOD:Source. To use this properly I would recommend thatyou have some idea of how to code a simple script; if you can do that then you should be able to make this work.

New Features -
- New Menu that shows Shortened and Lengthened versions of the Killstreaks.
- Now if you type "!kills" it tell you the kills you have.
- Allowance of more than 6 killstreaks. (Now Unlimited)
- "ks_playerdata" allows for the setting of variables to that userid. (Like WCSGroup)

 

There are 5 examples in there for you to look at.



Preset Variables -
Code: [Select]
ks_userid
ks_attacker
ks_kills
ks_health
ks_damage
ks_rand
ks_tmp
ks_tmp1
ks_tmp2
ks_tmp3
ks_tmp4
ks_tmp5
ks_tmp6


I will post a tutorial of how to make different rewards below:

« Last Edit: May 10, 2011, 06:07:55 PM by Predz »


Offline Predz

  • Level 6 Experienced
  • *****
  • Posts: 120
  • Country:
  • Adding New Addons for Eventscripts.
Re: [Addon] Killstreaks - Python (Basic ES Experience Required)
« Reply #1 on: May 10, 2011, 06:05:20 PM »
Python - Killstreaks Tutorial


To make a Killstreak Load using this mod you must create a new folder inside "killstreaks/powerups" as you would in the eventscripts folder.
Then add the code below:

Code: [Select]
block load
{
              ks_register <Path> <"Killstreak Name"> <"Description of Killstreak"> <Amount of Kills Needed>
}

block unload
{
              ks_unregister <Path>
}



So a finished Killstreak would look as shown below:
Code: [Select]
block load
{
ks_register grenade/powerup "Predator Grenade" "Gives a really powerful grenade." 4
}

block unload
{
ks_unregister grenade/powerup
}

block powerup
{
es_give server_var(ks_attacker) weapon_hegrenade
es ks_playerdata set server_var(ks_attacker) grenade 1
}

event player_hurt
{

// Is the Weapon a Grenade?
if (event_var(weapon) == "hegrenade") do
{

// Are you sure the weapon is not done by the world? (For Security)
if (event_var(attacker) != 0) do
{

// Getting the Players Variable using "ks_playerdata".
es ks_playerdata get server_var(ks_attacker) grenade ks_tmp
if (server_var(ks_tmp) == 1) do
{

// If it is set to 1 then do extra damage and reset the killstreak variable to 0.
es damage event_var(userid) event_var(health) 32 server_var(ks_userid)
es ks_playerdata set server_var(ks_attacker) grenade 0
}
}
}
}

Offline |MN|Jack Bauer

  • Level 2 Apprentice
  • **
  • Posts: 51
  • Country:
  • Murdernetworks.com
    • Murdernetworks
Re: [Addon] Killstreaks - Python (Basic ES Experience Required)
« Reply #2 on: August 28, 2011, 09:54:53 PM »
Is this suppose to continue the reward on each round?


 


Powered by EzPortal