AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Suggestion / Subplugin Request REQ ZP5 Admin ammo donate (https://forums.alliedmods.net/showthread.php?t=183923)

saywow 04-28-2012 13:07

REQ ZP5 Admin ammo donate
 
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

naSTR 04-28-2012 14:11

Re: REQ ZP5 Admin ammo donate
 
Search harder! Read this first! And the plugin by H.RED.ZONE

saywow 04-28-2012 14:14

Re: REQ ZP5 Admin ammo donate
 
he's talking about player donate i guess and not admin donate
U gived me the wrong plugin

H.RED.ZONE 04-28-2012 15:29

Re: REQ ZP5 Admin ammo donate
 
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); } 


saywow 04-28-2012 15:43

Re: REQ ZP5 Admin ammo donate
 
ah oki tank you !


All times are GMT -4. The time now is 18:43.

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