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

[HELP] Ammo packs reward for surviving


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Armin
Junior Member
Join Date: Feb 2010
Location: Estonia
Old 02-06-2010 , 11:09   [HELP] Ammo packs reward for surviving
Reply With Quote #1

How is it possible to get ammopacks for surviving in round end.
For example, the round ended, the human A is alive, he got 2 ammopacks. Human B is dead, and he got nothing... Also it can usable for zombies - if the round ened, all alive zombies get 1 ammo.
Are there any cvars in zombie_plague for this thing?
__________________
Armin is offline
Send a message via ICQ to Armin
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 02-06-2010 , 18:17   Re: [HELP] Ammo packs reward for surviving
Reply With Quote #2

Heres another good plugin by me

PHP Code:
/*================================================================================

    [ZP] Addon: Ammopacks for Surviving
    Copyright (C) 2010 by meTaLiCroSS, Viņa del Mar, Chile
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    In addition, as a special exception, the author gives permission to
    link the code of this program with the Half-Life Game Engine ("HL
    Engine") and Modified Game Libraries ("MODs") developed by Valve,
    L.L.C ("Valve"). You must obey the GNU General Public License in all
    respects for all of the code used other than the HL Engine and MODs
    from Valve. If you modify this file, you may extend this exception
    to your version of the file, but you are not obligated to do so. If
    you do not wish to do so, delete this exception statement from your
    version.

=================================================================================*/

#include <amxmodx>
#include <zombieplague>

new cvar_apamount

new bool:g_bIsConnected[33]

new 
g_iMaxPlayersg_msgSayText

#define PLUG_VERSION "0.1.2"
#define PLUG_AUTH "meTaLiCroSS"

#define is_user_valid_connected(%1)     (1 <= %1 <= g_iMaxPlayers && g_bIsConnected[%1])
#define zp_add_user_ammo_packs(%1,%2) zp_set_user_ammo_packs(%1, zp_get_user_ammo_packs(%1)+%2)

/*================================================================================
 [Init]
=================================================================================*/

public plugin_init()
{
    
register_plugin("[ZP] Addon: Ammopacks for Surviving"PLUG_VERSIONPLUG_AUTH)
    
    
cvar_apamount register_cvar("zp_ap_forsurviving""2")
    
    new 
szCvar[30]
    
formatex(szCvarcharsmax(szCvar), "v%s by %s"PLUG_VERSIONPLUG_AUTH)
    
register_cvar("zp_addon_ap_forsurviving"szCvarFCVAR_SERVER|FCVAR_SPONLY
    
    
g_iMaxPlayers get_maxplayers()
    
g_msgSayText get_user_msgid("SayText")
}

/*================================================================================
 [Main Forwards]
=================================================================================*/

public client_putinserver(id)
{
    
g_bIsConnected[id] = true
}

public 
client_disconnect(id)
{
    
g_bIsConnected[id] = false
}

/*================================================================================
 [ZombiePlague Forwards]
=================================================================================*/

public zp_round_ended(winteam)
{
    new 
iAmount get_pcvar_num(cvar_apamount)
    
    if(!
iAmount// disabled
        
return;
        
    static 
id
    
for(id 1id <= g_iMaxPlayersid++)
    {
        if(
is_user_valid_connected(id) && is_user_alive(id))
        {
            if(
zp_get_user_zombie(id) || zp_get_user_survivor(id))
                continue;
                
            
client_printcolor(id"/g[ZP]/y You won %d ammo packs for surviving this round"iAmount)
            
zp_add_user_ammo_packs(idiAmount)
        }
            
    }
}

/*================================================================================
 [Stocks]
=================================================================================*/

stock client_printcolor(id, const input[], any:...)
{
    static 
iPlayersNum[32], iCountiCount 1
    
static szMsg[191]
    
    
vformat(szMsgcharsmax(szMsg), input3)
    
    
replace_all(szMsg190"/g""^4"// green txt
    
replace_all(szMsg190"/y""^1"// orange txt
    
replace_all(szMsg190"/ctr""^3"// team txt
    
replace_all(szMsg190"/w""^0"// team txt
    
    
if(idiPlayersNum[0] = id
    
else get_players(iPlayersNumiCount"ch")
        
    for (new 
0iCounti++)
    {
        if (
g_bIsConnected[iPlayersNum[i]])
        {
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_iPlayersNum[i])
            
write_byte(iPlayersNum[i])
            
write_string(szMsg)
            
message_end()
        }
    }

__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross

Last edited by meTaLiCroSS; 02-07-2010 at 12:04.
meTaLiCroSS is offline
Armin
Junior Member
Join Date: Feb 2010
Location: Estonia
Old 02-07-2010 , 03:25   Re: [HELP] Ammo packs reward for surviving
Reply With Quote #3

wow! amazing!
Thank You!
__________________
Armin is offline
Send a message via ICQ to Armin
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 02-07-2010 , 12:05   Re: [HELP] Ammo packs reward for surviving
Reply With Quote #4

Quote:
Originally Posted by Armin View Post
wow! amazing!
Thank You!
Download it again, i forget to add something
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Armin
Junior Member
Join Date: Feb 2010
Location: Estonia
Old 02-07-2010 , 15:48   Re: [HELP] Ammo packs reward for surviving
Reply With Quote #5

Ok, redownloaded and recompiled
__________________
Armin is offline
Send a message via ICQ to Armin
sbornes
SourceMod Donor
Join Date: Jan 2010
Old 02-14-2010 , 04:24   Re: [HELP] Ammo packs reward for surviving
Reply With Quote #6

how do i make it so i get 5 aps for surviving humans?
i tried changing ("zp_ap_forsurviving", "5")

but its still 2?
sbornes is offline
Russiaboy
BANNED
Join Date: May 2009
Location: ZombiePlague is my Home
Old 02-14-2010 , 07:21   Re: [HELP] Ammo packs reward for surviving
Reply With Quote #7

change it in cvar.. maybe then work
Russiaboy is offline
Send a message via MSN to Russiaboy Send a message via Skype™ to Russiaboy
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 02-14-2010 , 13:49   Re: [HELP] Ammo packs reward for surviving
Reply With Quote #8

Quote:
Originally Posted by Russiaboy View Post
change it in cvar.. maybe then work
Yeah.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Armin
Junior Member
Join Date: Feb 2010
Location: Estonia
Old 02-15-2010 , 12:30   Re: [HELP] Ammo packs reward for surviving
Reply With Quote #9

Plugin works fine
__________________
Armin is offline
Send a message via ICQ to Armin
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 16:44.


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