View Full Version : dod_goodies4score? 2 nades for a cap.
etothep
10-07-2006, 03:53 AM
it seems to have vanished off the face of the web. Anyone know anything about this plugin.
The only purpose I'm concerned with is giving a player 2 grenades for the capture of a flag.
{SR} *Raggy*
10-07-2006, 09:57 AM
I only got the dod_scorerewards.sma....Sry
Outlawpapa
10-09-2006, 03:39 PM
Here is the sma for the plugin hope it helps....
//
// CVARs (for amxx.cfg):
// =====================
//
// gfs_enabled <1/0> = enable/disable plugin
// gfs_resetondeath <1/0> = reset flagcounters on
// death on/off
// gfs_healthflags <amount> = amount of flag caps to
// get health refilled
// gfs_nadeflags <amount> = amount of flag caps to
// get set amount of nades
// gfs_deathflags <amount> = amount of flag caps to
// decrease set amount of deaths
//
// gfs_removedeaths <amount> = sets amount of deaths to decrease
// gfs_givenades <amount> = sets amount of grenades to give
//
//
// NOTES:
// ======
//
// - the counters for health, nades and deaths are independent from
// each other, so it can happen that people get more than one goodie
// after some flagcaps as the single counters are reset to zero after
// a goodie was received.
//
// - the grenades feature isn't working for the Brits, so that whole
// feature is automatically disabled when a map with Brits instead
// of americans is played. health and deaths features stay enabled.
//
#include <amxmodx>
#include <dodx>
#include <dodfun>
#include <fun>
new zHealth[33]
new zGrenade[33]
new zDeath[33]
public plugin_init(){
register_plugin("DoD Goodies4Score","requested","[RST] FireStorm")
register_statsfwd(XMF_SCORE)
register_cvar("gfs_enabled","1")
register_cvar("gfs_resetondeath","1")
register_cvar("gfs_healthflags","2")
register_cvar("gfs_nadeflags","3")
register_cvar("gfs_deathflags","5")
register_cvar("gfs_removedeaths","2")
register_cvar("gfs_givenades","2")
register_event("ResetHUD","reset_flagcount","be")
}
public plugin_modules(){
require_module("fun")
require_module("dodx")
require_module("dodfun")
}
public client_authorized(id){
zHealth[id] = 0
zGrenade[id] = 0
zDeath[id] = 0
}
public reset_flagcount(id){
new zgfsEnabled = get_cvar_num("gfs_enabled")
new zDeathReset = get_cvar_num("gfs_resetondeath")
if(zgfsEnabled == 1 && zDeathReset == 1){
zHealth[id] = 0
zGrenade[id] = 0
zDeath[id] = 0
}
}
public client_score(index,score,total){
new zgfsEnabled = get_cvar_num("gfs_enabled")
if(zgfsEnabled == 1){
zHealth[index] ++
zGrenade[index] ++
zDeath[index] ++
check_score(index)
}
}
public check_score(index){
if(is_user_alive(index) == 1){
new zHealthFlags = get_cvar_num("gfs_healthflags")
new zNadeFlags = get_cvar_num("gfs_nadeflags")
new zDeathFlags = get_cvar_num("gfs_deathflags")
if(zHealth[index] == zHealthFlags){
new plHealth = get_user_health(index)
if(plHealth < 100){
set_user_health(index,100)
client_print(index,print_chat,"[DoD Goodies4Score] Your health has been refilled!")
}
zHealth[index] = 0
}
if(zGrenade[index] == zNadeFlags){
zGrenade[index] = 0
new zGrenAmmo = get_cvar_num("gfs_givenades")
if(get_user_team(index) == AXIS){
new CurrNades = dod_get_user_ammo(index,DODW_STICKGRENADE)
if(CurrNades == 0){
give_item(index,"weapon_stickgrenade")
}
dod_set_user_ammo(index,DODW_STICKGRENADE,(CurrNad es + zGrenAmmo))
}
else if(get_user_team(index) == ALLIES){
new CurrNades = dod_get_user_ammo(index,DODW_HANDGRENADE)
if(CurrNades == 0){
give_item(index,"weapon_handgrenade")
}
dod_set_user_ammo(index,DODW_HANDGRENADE,(CurrNade s + zGrenAmmo))
}
client_print(index,print_chat,"[DoD Goodies4Score] You have been given %d grenades!",zGrenAmmo)
}
if(zDeath[index] == zDeathFlags){
new zDeaths = dod_get_pl_deaths(index)
new zRemove = get_cvar_num("gfs_removedeaths")
if(zDeaths > 0){
dod_set_pl_deaths(index,(zDeaths -= zRemove))
client_print(index,print_chat,"[DoD Goodies4Score] Your deaths have been decreased by %d!",zRemove)
}
zDeath[index] = 0
}
}
return PLUGIN_CONTINUE
}
etothep
10-13-2006, 05:54 AM
wow everything i need right there (cvars included). thanks a sh*tload.
Outlawpapa
10-14-2006, 04:40 PM
Happy i can help. :cool:
etothep
11-27-2006, 07:24 PM
couple of compile errors having to do with the currNades spelled wrong in a couple places lol. heres the fix.
//
// CVARs (for amxx.cfg):
// =====================
//
// gfs_enabled <1/0> = enable/disable plugin
// gfs_resetondeath <1/0> = reset flagcounters on
// death on/off
// gfs_healthflags <amount> = amount of flag caps to
// get health refilled
// gfs_nadeflags <amount> = amount of flag caps to
// get set amount of nades
// gfs_deathflags <amount> = amount of flag caps to
// decrease set amount of deaths
//
// gfs_removedeaths <amount> = sets amount of deaths to decrease
// gfs_givenades <amount> = sets amount of grenades to give
//
//
// NOTES:
// ======
//
// - the counters for health, nades and deaths are independent from
// each other, so it can happen that people get more than one goodie
// after some flagcaps as the single counters are reset to zero after
// a goodie was received.
//
// - the grenades feature isn't working for the Brits, so that whole
// feature is automatically disabled when a map with Brits instead
// of americans is played. health and deaths features stay enabled.
//
#include <amxmodx>
#include <dodx>
#include <dodfun>
#include <fun>
new zHealth[33]
new zGrenade[33]
new zDeath[33]
public plugin_init(){
register_plugin("DoD Goodies4Score","requested","[RST] FireStorm")
register_statsfwd(XMF_SCORE)
register_cvar("gfs_enabled","1")
register_cvar("gfs_resetondeath","1")
register_cvar("gfs_healthflags","2")
register_cvar("gfs_nadeflags","3")
register_cvar("gfs_deathflags","5")
register_cvar("gfs_removedeaths","2")
register_cvar("gfs_givenades","2")
register_event("ResetHUD","reset_flagcount","be")
}
public plugin_modules(){
require_module("fun")
require_module("dodx")
require_module("dodfun")
}
public client_authorized(id){
zHealth[id] = 0
zGrenade[id] = 0
zDeath[id] = 0
}
public reset_flagcount(id){
new zgfsEnabled = get_cvar_num("gfs_enabled")
new zDeathReset = get_cvar_num("gfs_resetondeath")
if(zgfsEnabled == 1 && zDeathReset == 1){
zHealth[id] = 0
zGrenade[id] = 0
zDeath[id] = 0
}
}
public client_score(index,score,total){
new zgfsEnabled = get_cvar_num("gfs_enabled")
if(zgfsEnabled == 1){
zHealth[index] ++
zGrenade[index] ++
zDeath[index] ++
check_score(index)
}
}
public check_score(index){
if(is_user_alive(index) == 1){
new zHealthFlags = get_cvar_num("gfs_healthflags")
new zNadeFlags = get_cvar_num("gfs_nadeflags")
new zDeathFlags = get_cvar_num("gfs_deathflags")
if(zHealth[index] == zHealthFlags){
new plHealth = get_user_health(index)
if(plHealth < 100){
set_user_health(index,100)
client_print(index,print_chat,"[DoD Goodies4Score] Your health has been refilled!")
}
zHealth[index] = 0
}
if(zGrenade[index] == zNadeFlags){
zGrenade[index] = 0
new zGrenAmmo = get_cvar_num("gfs_givenades")
if(get_user_team(index) == AXIS){
new CurrNades = dod_get_user_ammo(index,DODW_STICKGRENADE)
if(CurrNades == 0){
give_item(index,"weapon_stickgrenade")
}
dod_set_user_ammo(index,DODW_STICKGRENADE,(CurrNad es + zGrenAmmo))
}
else if(get_user_team(index) == ALLIES){
new CurrNades = dod_get_user_ammo(index,DODW_HANDGRENADE)
if(CurrNades == 0){
give_item(index,"weapon_handgrenade")
}
dod_set_user_ammo(index,DODW_HANDGRENADE,(CurrNade s + zGrenAmmo))
}
client_print(index,print_chat,"[DoD Goodies4Score] You have been given %d grenades!",zGrenAmmo)
}
if(zDeath[index] == zDeathFlags){
new zDeaths = dod_get_pl_deaths(index)
new zRemove = get_cvar_num("gfs_removedeaths")
if(zDeaths > 0){
dod_set_pl_deaths(index,(zDeaths -= zRemove))
client_print(index,print_chat,"[DoD Goodies4Score] Your deaths have been decreased by %d!",zRemove)
}
zDeath[index] = 0
}
}
Would love it if this would compile for me. I have tried the amxmodx compiler and the online compiler... neither works. :mad:
I believe your looking for this:
http://www.dodplugins.net/forums/showthread.php?t=39&highlight=score
Search works!
Cheers!
YES INDEED!! Thank you Zor! U da man!! :cool: :cool:
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.