Ссылка на Сообщение
#1
30.1.2010, 14:46
KnifeOut
Please refer to this guide on installing eventscripts and eventscripts mods:
HOWTO: Installing Scripts and EventScripts Plugin
Please refer to this guide on installing eventscripts and eventscripts mods:
HOWTO: Installing Scripts and EventScripts Plugin
CODE
//KNIFEOUT MOD!//
//---CONFIG---//
block load
{
//Set this to 1 to enable the round message
es_xsetinfo round_message 1
//Change what you want the round message to say
es_xsetinfo Round_text "Knife a player to steal their cash!"
//Set this to 1 to enable the mugged announcement
es_xsetinfo announce_mugged 1
//Set this to 1 to enable the attackers taunt
es_xsetinfo attacker_taunt 1
//Set this to 1 to enable the victims cry
es_xsetinfo victims_cry 1
//Set the victims cry message
es_xsetinfo victim_text "I feel violated..."
//DO NOT EDIT BELOW THIS LINE UNLESS YOU ARE AN ADVANCED CODER
//DO NOT RE-RELEASE ANY EDITS WITHOUT THE AUTHORS PERMISSION
//-------------------------------------------------------------
es_xsetinfo Knifeout_1982 1
es_xmakepublic Knifeout_1982 1
// Prints a message to the chat saying the mod has been loaded
es_xmsg urmod_name [KnifeOut] Loaded!
}
block unload
{
es_xsetinfo Knifeout_1982 0
// Prints a message to the chat saying the mod has been unloaded
es_xmsg [KnifeOut] Unloaded!
}
//Executes on every new round
event round_start
{
// If the round_message variable is set to 1 then send the message
if (server_var(round_message) equalto 1) do
{
// Send the user defined message
es_msg [KnifeOUt] server_var(Round_text)
}
}
//Executes on every players death
event player_death
{
// If they are on the opposite team then do the code below
if (event_var(es_attackerteam) notequalto event_var(es_userteam) do
{
// If the weapon is a knife do the below
if (event_var(weapon) equalto knife) do
{
//Store the two cash variables for faster loading
es_xset attacker_cash 0
es_xset victim_cash 0
// Get the attackers cash and put it in the variable "attacker_cash"
es playerget cash attacker_cash event_var(attacker)
// Get the victims cash and put it in the variable "victim_cash"
es playerget cash victim_cash event_var(userid)
// Add the victims cash to the attackers cash
es_math attacker_cash + server_var(victim_cash)
// Set the cash of the attacker to the attacker_cash variable (Which now has the victim cash added to it)
es playerset cash event_var(attacker) attacker_cash
//Print a message With the knifeout part in bright green, saying that: "attacker name here" mugged "victim name here" for "victims cash here"
es_msg #multi#green[KnifeOut]#default event_var(attackername) Mugged event_var(es_username) for server_var(victim_cash)
//Makes the attacker say: Thanks, I really needed an extra "Victims cash here"
es_cexec event_var(attacker) say Thanks, I really needed an extra event_var(victim_cash)
//Makes the victim say the user set text
es_cexec event_var(userid) say server_var(victim_text)
// Sets the victims cash to 0
es playerset cash event_var(userid) 0
//Plays the bot owned sound
es_emitsound player event_var(attacker) "/bots/owned.wav" 1.0 0.6
}
}
}
//---CONFIG---//
block load
{
//Set this to 1 to enable the round message
es_xsetinfo round_message 1
//Change what you want the round message to say
es_xsetinfo Round_text "Knife a player to steal their cash!"
//Set this to 1 to enable the mugged announcement
es_xsetinfo announce_mugged 1
//Set this to 1 to enable the attackers taunt
es_xsetinfo attacker_taunt 1
//Set this to 1 to enable the victims cry
es_xsetinfo victims_cry 1
//Set the victims cry message
es_xsetinfo victim_text "I feel violated..."
//DO NOT EDIT BELOW THIS LINE UNLESS YOU ARE AN ADVANCED CODER
//DO NOT RE-RELEASE ANY EDITS WITHOUT THE AUTHORS PERMISSION
//-------------------------------------------------------------
es_xsetinfo Knifeout_1982 1
es_xmakepublic Knifeout_1982 1
// Prints a message to the chat saying the mod has been loaded
es_xmsg urmod_name [KnifeOut] Loaded!
}
block unload
{
es_xsetinfo Knifeout_1982 0
// Prints a message to the chat saying the mod has been unloaded
es_xmsg [KnifeOut] Unloaded!
}
//Executes on every new round
event round_start
{
// If the round_message variable is set to 1 then send the message
if (server_var(round_message) equalto 1) do
{
// Send the user defined message
es_msg [KnifeOUt] server_var(Round_text)
}
}
//Executes on every players death
event player_death
{
// If they are on the opposite team then do the code below
if (event_var(es_attackerteam) notequalto event_var(es_userteam) do
{
// If the weapon is a knife do the below
if (event_var(weapon) equalto knife) do
{
//Store the two cash variables for faster loading
es_xset attacker_cash 0
es_xset victim_cash 0
// Get the attackers cash and put it in the variable "attacker_cash"
es playerget cash attacker_cash event_var(attacker)
// Get the victims cash and put it in the variable "victim_cash"
es playerget cash victim_cash event_var(userid)
// Add the victims cash to the attackers cash
es_math attacker_cash + server_var(victim_cash)
// Set the cash of the attacker to the attacker_cash variable (Which now has the victim cash added to it)
es playerset cash event_var(attacker) attacker_cash
//Print a message With the knifeout part in bright green, saying that: "attacker name here" mugged "victim name here" for "victims cash here"
es_msg #multi#green[KnifeOut]#default event_var(attackername) Mugged event_var(es_username) for server_var(victim_cash)
//Makes the attacker say: Thanks, I really needed an extra "Victims cash here"
es_cexec event_var(attacker) say Thanks, I really needed an extra event_var(victim_cash)
//Makes the victim say the user set text
es_cexec event_var(userid) say server_var(victim_text)
// Sets the victims cash to 0
es playerset cash event_var(userid) 0
//Plays the bot owned sound
es_emitsound player event_var(attacker) "/bots/owned.wav" 1.0 0.6
}
}
}