Raised This Month: $32 Target: $400
 8% 

Suggestion / Subplugin Request Request Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShooTeR XKy
Member
Join Date: Jul 2014
Location: Palestine
Old 02-09-2017 , 04:34   Request Plugin
Reply With Quote #1

hi guys i saw that in cool server
when i shot Zombie its show me i got ammo [+1 ammo]
i want that plugin

ShooTeR XKy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-09-2017 , 08:28   Re: Request Plugin
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN "+1 Ammo Packs"
#define VERSION "1.0"
#define AUTHOR "DoNii"

#define is_valid_connected(%1) (1 <= %1 <= g_maxplayers)

new g_maxplayers;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_TakeDamage"player""fw_HamTakeDamagePost"1)
    
    
g_maxplayers get_maxplayers()
}

public 
fw_HamTakeDamagePost(victiminflictorattackerFloat:damagedamagegibs) {
    
    if(!
is_valid_connected(attacker)) 
        return 
HAM_IGNORED;
    
    
set_hudmessage(2552552550.500.5006.012.0)
    
show_hudmessage(attacker"[+1 Ammo Packs]")
    
zp_set_user_ammo_packs(attackerzp_get_user_ammo_packs(attacker) + 1)
    
    return 
HAM_IGNORED;

__________________
edon1337 is offline
ShooTeR XKy
Member
Join Date: Jul 2014
Location: Palestine
Old 02-11-2017 , 02:17   Re: Request Plugin
Reply With Quote #3

do i make it plugins and compile
or
add it to Zombie file Zombieplague.sma ?????
ShooTeR XKy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-11-2017 , 05:25   Re: Request Plugin
Reply With Quote #4

New plugin.
__________________
edon1337 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-11-2017 , 12:00   Re: Request Plugin
Reply With Quote #5

@edon yours doesn't do what he requested tho.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
GasmoN
Member
Join Date: Jul 2014
Old 02-12-2017 , 16:14   Re: Request Plugin
Reply With Quote #6

It's plugin from some russian site, i translated it for you.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <zombieplague>

new ammo[3][33],string[21],cvarShowType,ammopacks

public plugin_init() {
    
register_plugin("[ZP] AmmoChange""1.0""ZETA [M|E|N]")
    
register_logevent("round_start"2"1=Round_Start")
    
cvarShowType register_cvar("ac_show_type""1")
    
    
register_clcmd("say /change","func_change",ADMIN_ALL,"")
}

public 
round_start() {
    new 
players[32],num,i
    get_players
(players,num)
    
    for(
i=1;i<num;i++) {
        
ammo[0][players[i]] = zp_get_user_ammo_packs(players[i])
    }
}

public 
client_putinserver(id) {
    
set_task(3.0,"func_ammo",id)
}

public 
func_ammo(id) {
    
ammopacks zp_get_user_ammo_packs(id)
    
    
ammo[0][id] = ammopacks
    ammo
[1][id] = ammopacks
    ammo
[2][id] = ammopacks
    
    set_task
(1.0,"change_ammo",id,_,_,"b")
}

public 
change_ammo(id) {
    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        return 
PLUGIN_HANDLED
        
    ammo
[1][id] = zp_get_user_ammo_packs(id)
        
    if(
ammo[1][id] != ammo[2][id]) {
        if(
ammo[1][id] > ammo[2][id]) {
            
ammopacks ammo[1][id] - ammo[2][id]
            
format(string,charsmax(string),"[ +%d Ammo ]"ammopacks)
        }
        else {
            
ammopacks ammo[2][id] - ammo[1][id]
            
format(string,charsmax(string),"[ -%d Ammo ]"ammopacks)
        }
        
        
ammo[2][id] = ammo[1][id]
        
        if(
get_pcvar_num(cvarShowType)) {
            
set_hudmessage(1801801800.510.5106.03.0,_,_,3)
            
show_hudmessage(id"%s"string)
        }
        else
            
client_print(idprint_center"%s"string)
    }
    
    return 
PLUGIN_HANDLED
}

public 
client_disconnect(id) {
    
ammo[0][id] = 0
    ammo
[1][id] = 0
    ammo
[2][id] = 0
    
    remove_task
(id)
}

public 
func_change(id) {
    if(
ammo[0][id] != ammo[2][id]) {
        if(
ammo[0][id] > ammo[2][id]) {
            
ammopacks ammo[0][id] - ammo[2][id]
            
client_print(id,print_chat,"[ZP] Your ammo dropped by %d."ammopacks)
        }
        else {
            
ammopacks ammo[2][id] - ammo[0][id]
            
client_print(id,print_chat,"[ZP] Your ammo increased by %d."ammopacks)
        }
    }
    else 
        
client_print(id,print_chat,"[ZP] Your ammo is not changed.")
    return 
PLUGIN_HANDLED

Or download it from attachments
Attached Files
File Type: sma Get Plugin or Get Source (zp_ammochange.sma - 475 views - 2.1 KB)

Last edited by GasmoN; 02-12-2017 at 16:14.
GasmoN is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-12-2017 , 16:17   Re: Request Plugin
Reply With Quote #7

Quote:
Originally Posted by georgik57 View Post
@edon yours doesn't do what he requested tho.
Why?
__________________
edon1337 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-12-2017 , 16:18   Re: Request Plugin
Reply With Quote #8

Quote:
Originally Posted by edon1337 View Post
Why?
well read the zp source code and see when it changes the ammo packs value and then read yours
also you might want to read again what he requested
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Kotoamatsukami
Member
Join Date: Jan 2017
Location: Malaysia
Old 02-13-2017 , 07:29   Re: Request Plugin
Reply With Quote #9

Quote:
Originally Posted by georgik57 View Post
well read the zp source code and see when it changes the ammo packs value and then read yours
also you might want to read again what he requested
Do you mean, pointing to the main source code which hold max damage will earn the player 1 AP then check if the damage done ( in Ham_TakeDamage ) is equal to the pointer. Thus, resulting in printing the '+1 Ammopack' ?
Kotoamatsukami is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-13-2017 , 09:42   Re: Request Plugin
Reply With Quote #10

Quote:
Originally Posted by Kotoamatsukami View Post
Do you mean, pointing to the main source code which hold max damage will earn the player 1 AP then check if the damage done ( in Ham_TakeDamage ) is equal to the pointer. Thus, resulting in printing the '+1 Ammopack' ?
y
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode