Raised This Month: $51 Target: $400
 12% 

Suggestion / Subplugin Request REQ ZP5 Admin ammo donate


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
saywow
Senior Member
Join Date: Oct 2010
Old 04-28-2012 , 13:07   REQ ZP5 Admin ammo donate
Reply With Quote #1

Hi,
I searched an admin donate ammo plugin (and not player donate ammo plugin) , can any one give it to me ? (for zp5) can't find it here : http://forums.alliedmods.net/showthread.php?t=175051
__________________
saywow is offline
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 04-28-2012 , 14:11   Re: REQ ZP5 Admin ammo donate
Reply With Quote #2

Search harder! Read this first! And the plugin by H.RED.ZONE
__________________
naSTR is offline
saywow
Senior Member
Join Date: Oct 2010
Old 04-28-2012 , 14:14   Re: REQ ZP5 Admin ammo donate
Reply With Quote #3

he's talking about player donate i guess and not admin donate
U gived me the wrong plugin
__________________

Last edited by saywow; 04-28-2012 at 14:15.
saywow is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 04-28-2012 , 15:29   Re: REQ ZP5 Admin ammo donate
Reply With Quote #4

Change ADMIN_ADMIN to what ever you want --> http://www.amxmodx.org/funcwiki.php?go=module&id=1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <zp50_ammopacks>

new g_UserTotalAmmo[33]
new 
g_CvarAllowDonate

public plugin_init() {
    
register_plugin "[ZP50] Addon: Donate AP" "1.0" "H.RED.ZONE" )
    
    
g_CvarAllowDonate register_cvar "zp_stats_allow_donate" "1" )
    
    
register_clcmd "say" "handleSay"ADMIN_ADMIN "Donate Ammo Packs " 
    
register_clcmd "say_team" "handleSay"ADMIN_ADMIN "Donate Ammo Packs " )
    
    
register_event "HLTV" "RoundStart" "a" "1=0" "2=0" ); }

public 
RoundStart() {
    if ( 
get_pcvar_num g_CvarAllowDonate ) )
    
set_task 2.2 "MsgOnRoundStart" )
    
set_task 12.2 "MsgOnRoundStart")
    
set_task 22.2 "MsgOnRoundStart"); }

public 
MsgOnRoundStart() {
    if ( 
get_pcvar_num g_CvarAllowDonate ) )
        
ColorChat GREEN ,  "^1[^4ZP^1]^1To ^4donate^1 others Ammo Packs, type ^4/donate <nick> <amount>" ); }

public 
handleSay id level cid ) {
    if ( !
cmd_access id level cid ) )
    return 
PLUGIN_HANDLED
    
new args 64 ]
    
read_args args charsmax args ) )
    
remove_quotes args )
    new 
arg1 16 ]
    new 
arg2 32 ]
    
strbreak args arg1 charsmax arg1 ) , arg2 charsmax arg2 ) )
    if ( 
get_pcvar_num g_CvarAllowDonate ) && equal arg1 ,"/donate" ) )
    
donate id arg2 
    return 
PLUGIN_HANDLED; }

public 
donate idarg[]) {
    new 
to [32], count[10]
    
strbreak(argto31count9)
    
    if (!
to ] || !count ] ) {
        
ColorChat id GREEN"^1[^4ZP^1]^1To use^4 donate^1: say ^4/donate <name> <amount>")
        return; }
    new 
ammo_sender zp_ammopacks_get id )
    new 
ammo
    
if ( equal count "all" ) )
        
ammo ammo_sender
    
else
        
ammo str_to_num count )
    if ( 
ammo <= ) {
        
ColorChat id GREEN"^1[^4ZP^1]^1Wrong ammo quantity!")
        return; }
        
    
ammo_sender -= ammo
    
if (ammo_sender 0){
        
ammo+=ammo_sender
        ammo_sender 
0; }
    new 
reciever cmd_target(idto, (CMDTARGET_ALLOW_SELF))
    if (!
reciever || reciever == id) {
        
ColorChat id GREEN"^1[^4ZP^1]^1Player ^4%s ^1has not been found on the server!"to)
        return; }
    
    
zp_ammopacks_set(recieverzp_ammopacks_get(reciever) + ammo)
    
g_UserTotalAmmo[reciever] += ammo
    zp_ammopacks_set
(idammo_sender)
    new 
aName[32], vName[32]
    
    
get_user_name(idaName31)
    
get_user_name(recievervName31)
    
    
set_hudmessage(25500, -1.00.306.06.0)
    
show_hudmessage(0"%s donated %d Ammo Packs to %s!"aNameammovName); } 
__________________
H.RED.ZONE is offline
saywow
Senior Member
Join Date: Oct 2010
Old 04-28-2012 , 15:43   Re: REQ ZP5 Admin ammo donate
Reply With Quote #5

ah oki tank you !
__________________
saywow is offline
Reply



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 22:41.


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