| closedGrenades for all classes |
| Started by Punisher on 12-28-2008, 01:28 AM |
Threads: 8
Joined: Feb 2007
Ok, So in a realism server they had a plugin that no matter what class you had, you got 2 grenades. Do you guys know where I could find this plugin?
Threads: 103
Joined: May 2005
this plugin will give snipers, mgs, and rocket classes 1 nade...nnhttps://www.dodplugins.net/forums/showthread.php?t=60nnnbut if you open the sma file you can easily make it twonnfind:n
public give_nade(id){n if(is_user_connected(id) == 1 && is_user_alive(id) == 1){ n if(get_user_team(id) == 2){n give_item(id, "weapon_stickgrenade")n }n else if(get_user_team(id) == 1){n give_item(id, "weapon_handgrenade")n }n }n return PLUGIN_HANDLEDn}nnchange to:npublic give_nade(id){n if(is_user_connected(id) == 1 && is_user_alive(id) == 1){ n if(get_user_team(id) == 2){n give_item(id, "weapon_stickgrenade")n give_item(id, "weapon_stickgrenade")n }n else if(get_user_team(id) == 1){n give_item(id, "weapon_handgrenade")n give_item(id, "weapon_handgrenade")n }n }n return PLUGIN_HANDLEDn}Threads: 75
Joined: Nov 2007
lol or try this rnrn
//////////////////////////////////////////////////////////////////////////////////rn//rn// DoD 2 Nades For Allrn// - Version 1.1rn// - 08.06.2006rn// - diamond-optic (original code by FireStorm)rn//rn//////////////////////////////////////////////////////////////////////////////////rn//rn// Credit:rn//rn// - Original Code by FireStorm (dod_nadeforall v0.5beta)rn//rn// Information:rn//rn// - This will allow you to give snipers, mgs, and rocketsrn// a grenade when they spawn.rn//rn// CVARs:rn//rn// dod_nadeforall "1" //Turn on(1)/off(0)rn//rn// dod_nadeforall_snipers "1" //Turn on(1)/off(0) give 2 nades to snipersrn// dod_nadeforall_mgs "1" //Turn on(1)/off(0) give 2 nades to mgsrn// dod_nadeforall_rockets "1" //Turn on(1)/off(0) give 2 nades to rocketsrn// dod_nadeforall_sergeants "1" // Turn on(1)/off(0) extra nade for mp40 mp44 etcrn// dod_nadeforall_K43_M1 "1" // Turn on(1)/off(0) extra nade for k43 and m1rn// dod_nadeforall_support_infantry "1" //Turn on(1)/off(0) extra nade for bar / fg42rn//rn// Changelog:rn//rn// - 05.27.2005 Version 0.5betarn// Initial Release by FireStormrn//rn// - 08.04.2006 Version 1.0 ****** FIX THIS DATE!!!!! ******rn// Modification of FireStorms original codern//rn// - 08.06.2006 Version 1.1rn// Changed some returnsrn// Corrected Changelog mistakern//rn//////////////////////////////////////////////////////////////////////////////////rnrn#include <amxmodx>rn#include <fun>rn#include <dodx>rnrn// 3 new pointers - p_dod_nadeforall_serge, p_dod_nadeforall_serge2 & p_dod_nadeforall_SIrnnew p_dod_nadeforall, p_dod_nadeforall_snipers, p_dod_nadeforall_mgs, p_dod_nadeforall_rockets, p_dod_nadeforall_serge, p_dod_nadeforall_serge2, p_dod_nadeforall_SIrnrnpublic plugin_init()rn{rn register_plugin("DoD 2 NadesForAll","1.0","AMXX DoD Team")rn rn register_cvar("dod_2_nadesforall_stats", "1.0", FCVAR_SERVER|FCVAR_SPONLY)rn rn p_dod_nadeforall = register_cvar("dod_nadesforall","1")rn rn p_dod_nadeforall_snipers = register_cvar("dod_nadeforall_snipers","1")rn p_dod_nadeforall_mgs = register_cvar("dod_nadeforall_mgs","1")rn p_dod_nadeforall_rockets = register_cvar("dod_nadeforall_rockets","1")rn rn // added by Dr.Grn p_dod_nadeforall_serge = register_cvar("dod_nadeforall_sergeants", "1")rn p_dod_nadeforall_serge2 = register_cvar("dod_nadeforall_K43_M1", "1")rn p_dod_nadeforall_SI = register_cvar("dod_nadeforall_support_infantry", "1")rn rn register_event("ResetHUD","check_class","be")rn}rnrnpublic check_class(id)rn{rn if((get_pcvar_num(p_dod_nadeforall) != 1) || !is_user_alive(id) || !is_user_connected(id) || is_user_hltv(id))rn return PLUGIN_CONTINUErn rn new pclass = dod_get_user_class(id)rn rn if((get_pcvar_num(p_dod_nadeforall_snipers) == 1) && (pclass == DODC_SCHARFSCHUTZE || pclass == DODC_SNIPER || pclass == DODC_MARKSMAN))rn {rn set_task(0.1,"give_nade",id) // First grenade rn set_task(0.2,"give_nade",id) // Second grenade. REMOVE this line if they already have 1 grenade or they will have 3, i cant rememberrn return PLUGIN_CONTINUErn }rn else if((get_pcvar_num(p_dod_nadeforall_mgs) == 1) && (pclass == DODC_MG34 || pclass == DODC_MG42 || pclass == DODC_30CAL))rn {rn set_task(0.1,"give_nade",id) // First grenadern set_task(0.2,"give_nade",id) //Second grenade. REMOVE this line if they already have 1 grenade or they will have 3, i cant rememberrn return PLUGIN_CONTINUErn }rn else if((get_pcvar_num(p_dod_nadeforall_rockets) == 1) && (pclass == DODC_PANZERJAGER || pclass == DODC_BAZOOKA || pclass == DODC_PIAT))rn {rn set_task(0.1,"give_nade",id)rn return PLUGIN_CONTINUErn }rn // sergeantrn else if((get_pcvar_num(p_dod_nadeforall_serge) == 1) && (pclass == DODC_THOMPSON || pclass == DODC_GREASE || pclass == DODC_MP40 || pclass == DODC_MP44 || pclass == DODC_STEN))rn {rn set_task(0.1,"give_nade",id)rn return PLUGIN_CONTINUErn }rn // sergeant 2rn else if((get_pcvar_num(p_dod_nadeforall_serge2) == 1) && (pclass == DODC_CARBINE || pclass == DODC_K43))rn {rn set_task(0.1,"give_nade",id)rn return PLUGIN_CONTINUErn }rn // Support infantryrn else if((get_pcvar_num(p_dod_nadeforall_SI) == 1) && (pclass == DODC_BAR || pclass == DODC_BREN || pclass == DODC_FG42 || pclass == DODC_SCOPED_FG42)) rn {rn set_task(0.1,"give_nade",id)rn return PLUGIN_CONTINUErn }rn return PLUGIN_CONTINUErn}rnrnpublic give_nade(id)rn{rn if(is_user_connected(id) == 1 && is_user_alive(id) == 1)rn { rn if(get_user_team(id) == 2)rn {rn give_item(id, "weapon_stickgrenade")rn }rn else if(get_user_team(id) == 1)rn {rn give_item(id, "weapon_handgrenade")rn }rn }rn return PLUGIN_HANDLEDrn}rnrnrn*EDIT*rnrnThis is not testet!!Threads: 37
Joined: Mar 2007
now say a person is a total nub at this scripting thing and wanted to make it so all classes offer this like say i want a grenadier class to have 3 nades and a bar class to have say 5 (we;re talking about myself here)nnall i gotta do is just edit out the " DODC_PIAT" and replace it with say DODC_BAR (not sure if its the right name for it but i can mamage reaserching the verc lol) , right? or wrong?
Threads: 75
Joined: Nov 2007
erm.... see my commentsrnrn
#include <amxmodx>rn#include <fun>rn#include <dodx>rnrn// pointersrnnew p_dod_nadeforall, p_dod_nadeforall_snipersrnrnpublic plugin_init()rn{rn // on/offrn p_dod_nadeforall = register_cvar("dod_nadesforall","1")rn // check sniper class.. this is only needed if u wanna build the plugin to check all classes, else u could use just p_dod_nadeforallrn p_dod_nadeforall_snipers = register_cvar("dod_nadeforall_snipers","1")rn // check respawn ~ ResetHUD check out http://www.amxmodx.org/funcwiki.php?search=register_event&go=searchrn register_event("ResetHUD","check_class","be")rn}rnrnpublic check_class(id)rn{rn //first check... is plugin enabled, is user alive, is user connected, and is user HLTVrn if((get_pcvar_num(p_dod_nadeforall) != 1) || !is_user_alive(id) || !is_user_connected(id) || is_user_hltv(id))rn return PLUGIN_CONTINUErn // rn new pclass = dod_get_user_class(id)rn rn if((get_pcvar_num(p_dod_nadeforall_snipers) == 1) && (pclass == DODC_SCHARFSCHUTZE || pclass == DODC_SNIPER || pclass == DODC_MARKSMAN))rn // if p_dod_nadeforall_snipers is 1 and class is equal to DODC_SCHARFSCHUTZE, DODC_SNIPER or DODC_MARKSMAN run the next lines (set_task....)rn {rn //set task (time in sec, "task", id)rn // Note D-O's comment above, this might not be the best way but a possible way.rn // Ive set the task twice cuz then I can X amount of times and it wont give two nades everytime rn set_task(0.1,"give_nade",id) // First grenade rn set_task(0.2,"give_nade",id) // Second grenade.rnrn return PLUGIN_CONTINUErn }rn}rn// give the client the nadernpublic give_nade(id)rn{rn // check if user is alive and connectedrn if(is_user_connected(id) == 1 && is_user_alive(id) == 1)rn { rn //team check one (axis)rn if(get_user_team(id) == 2)rn {rn //give the nadern give_item(id, "weapon_stickgrenade")rn }rn //team cheak two (us/brits)rn else if(get_user_team(id) == 1)rn {rn //give the nadern give_item(id, "weapon_handgrenade")rn }rn }rn return PLUGIN_HANDLEDrn}rnrnrnanyone correct me if iam wrong :)Threads: 59
Joined: Jan 2007
But why not use this plugin link: https://www.dodplugins.net/forums/showthread.php?t=242&highlight=custom+loadrnrnIt's a plugin which allow you to customise the entire weapon load of any class.
Threads: 103
Joined: May 2005
good point

