Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[rezolvat]Cerere edit la un plugin
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
471
vitanfitt
[Veni Vidi Vici]
Status: Offline
(since 09-10-2018 20:27)
Joined: 13 Oct 2016
Posts: 214
,
Topics: 25
Location:
Gym
Reputation:
46.8
Votes
: 20
Posted: 06-11-2016, 22:53:05
| Translate post to:
... (
Click for more languages
)
Salut, am si eu nevoie de un edit la un plugin, mai exact asta:
Quote:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Bonus"
#define VERSION "1.2"
#define AUTHOR "Xalus"
#define Tag "[RESPAWN.Freakz.Ro]"
new cStatus, cMaxHealth;
new cKill, cKnife, cHeadshot, cKnifeHeadshot;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
/* Cvar */
cStatus = register_cvar("bonus_status", "1");
cMaxHealth = register_cvar("bonus_maxhealth", "750");
/* Bonus */
cKill = register_cvar("bonus_kill", "5");
cKnife = register_cvar("bonus_knife", "15");
cHeadshot = register_cvar("bonus_headshot", "10");
cKnifeHeadshot = register_cvar("bonus_knifeheadshot", "25");
/* Player Killed */
register_event( "DeathMsg", "EventDeathMsg", "a", "1>0" );
}
/*
Bonus:
- Player Killed
*/
public EventDeathMsg() {
new killer = read_data(1);
new victim = read_data(2);
new headshot = read_data(3);
new weapon = get_user_weapon(killer);
new num;
if(killer == victim || !get_pcvar_num(cStatus) || !is_user_connected(victim) || !is_user_alive(killer))
return PLUGIN_HANDLED;
if(headshot && weapon == CSW_KNIFE) {
num = get_pcvar_num(cKnifeHeadshot)
GiveHealth(killer, num)
HudMessage(killer, "Ai primit +%ihp", num)
} else if(headshot) {
num = get_pcvar_num(cHeadshot)
GiveHealth(killer, num)
HudMessage(killer, "Ai primit +%ihp", num)
} else if(weapon == CSW_KNIFE) {
num = get_pcvar_num(cKnife)
GiveHealth(killer, num)
HudMessage(killer, "Ai primit +%ihp", num)
} else {
num = get_pcvar_num(cKill)
GiveHealth(killer, num)
HudMessage(killer, "Ai primit +%ihp", num)
}
return PLUGIN_CONTINUE;
}
/*
Bonus:
- Give Health
- Hud Message
*/
GiveHealth(id, count)
set_user_health(id, min( (get_user_health(id) + count), get_pcvar_num(cMaxHealth) ))
stock HudMessage(const id, const input[], any:...) {
static msg[191];
vformat(msg, 190, input, 3);
set_hudmessage(127, 170, 255, 0.27, 0.14, 0, 5.0, 5.0, 0.0, 0.0, -1);
show_hudmessage(id, "%s^n%s", Tag, msg)
}
sa arate mesajele in Text, nu in Hud
multumesc![/code][/quote]
Maybe you should train as hard as you hate
0
0
Back to top
destroi112
[DEV]
Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042
,
Topics: 119
Location:
---------
Reputation:
515.9
Votes
: 118
Posted: 07-11-2016, 17:13:57
| Translate post to:
... (
Click for more languages
)
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Bonus"
#define VERSION "1.2"
#define AUTHOR "Xalus"
#define Tag "[RESPAWN.Freakz.Ro]"
new cStatus, cMaxHealth;
new cKill, cKnife, cHeadshot, cKnifeHeadshot;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
/* Cvar */
cStatus = register_cvar("bonus_status", "1");
cMaxHealth = register_cvar("bonus_maxhealth", "750");
/* Bonus */
cKill = register_cvar("bonus_kill", "5");
cKnife = register_cvar("bonus_knife", "15");
cHeadshot = register_cvar("bonus_headshot", "10");
cKnifeHeadshot = register_cvar("bonus_knifeheadshot", "25");
/* Player Killed */
register_event( "DeathMsg", "EventDeathMsg", "a", "1>0" );
}
/*
Bonus:
- Player Killed
*/
public EventDeathMsg() {
new killer = read_data(1);
new victim = read_data(2);
new headshot = read_data(3);
new weapon = get_user_weapon(killer);
new num;
if(killer == victim || !get_pcvar_num(cStatus) || !is_user_connected(victim) || !is_user_alive(killer))
return PLUGIN_HANDLED;
if(headshot && weapon == CSW_KNIFE)
{
num = get_pcvar_num(cKnifeHeadshot)
GiveHealth(killer, num)
}else if(headshot) {
num = get_pcvar_num(cHeadshot)
GiveHealth(killer, num)
}else if(weapon == CSW_KNIFE) {
num = get_pcvar_num(cKnife)
GiveHealth(killer, num)
}else {
num = get_pcvar_num(cKill)
GiveHealth(killer, num)
}
client_print(killer,print_chat, "Ai primit +%ihp", num)
return PLUGIN_CONTINUE;
}
GiveHealth(id, count)
{
set_user_health(id, min( (get_user_health(id) + count), get_pcvar_num(cMaxHealth) ));
}
Retired from Amxmodx
0
0
Back to top
vitanfitt
[Veni Vidi Vici]
Status: Offline
(since 09-10-2018 20:27)
Joined: 13 Oct 2016
Posts: 214
,
Topics: 25
Location:
Gym
Reputation:
46.8
Votes
: 20
Posted: 07-11-2016, 17:46:33
| Translate post to:
... (
Click for more languages
)
dap, merge dar numai apare tag-ul ala [RESPAWN.Freakz.Ro] il poti pune sa apara sau macar sa-l scoti din script? ca poate daca sterg doar #define tag, numai merge scriptul
p.s; am adaugat eu
Code:
client_print(killer,print_chat, "%s Ai primit +%ihp",Tag, num)
mersi frumos bro, cheers!
Maybe you should train as hard as you hate
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Locked by
destroi112
, 07 November 2016 18:18
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 27-04-2024, 23:13:23
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details