Raised This Month: $ Target: $400
 0% 

ammopack problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-03-2009 , 13:14   Re: ammopack problem
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <zombieplague>
 
public plugin_init( )
{
    
register_plugin"Survivor, Nemesis Kill Rewards | End Round Reward""1.0""asd" )
    
register_event"DeathMsg""event_death""a" )
}
public 
event_death( )
{
     static 
attacker
     
if ( zp_get_user_survivor( ( attacker read_data) ) ) || zp_get_user_nemesisattacker ) )
          
zp_set_user_ammo_packsattackerzp_get_user_ammo_packsattacker ) + )

SnoW is offline
Send a message via MSN to SnoW
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 09-04-2009 , 06:16   Re: ammopack problem
Reply With Quote #2

Second Problem.

PHP Code:
#include <amxmodx>
#include <zombieplague>
 
new g_pCvarAmmo]
new 
g_iMaxPlayers
 
public plugin_init( )
{
    
register_plugin"End Round Reward""1.0""asd" )
    
g_pCvarAmmo] = register_cvar"humans_ammopack""5" )
    
g_pCvarAmmo] = register_cvar"zombies_ammopack""5" )
 
    
g_iMaxPlayers get_maxplayers( )
}
 
public 
zp_round_endedteam )
{
 for ( new 
1<= g_iMaxPlayersi++ )
 {
  if ( !
is_user_alive) )
   continue
 
  switch ( 
team )
  {
   case 
WIN_HUMANSzp_set_user_ammo_packsizp_get_user_ammo_packs) +get_pcvar_numg_pCvarAmmo] ) )
   case 
WIN_ZOMBIESzp_set_user_ammo_packsizp_get_user_ammo_packs) +get_pcvar_numg_pCvarAmmo] ) )
  }
 }

Sometime it doesn't work.

I want it like if human win at the end round it give them ammo pack
Mr.Noobie is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-04-2009 , 07:13   Re: ammopack problem
Reply With Quote #3

Try this
PHP Code:
#include <amxmodx>
#include <zombieplague>
 
new g_pCvarAmmo];
 
public 
plugin_init( ) {
    
register_plugin"End Round Reward""1.0""asd" );
    
    
g_pCvarAmmoWIN_HUMANS ] = register_cvar"humans_ammopack""5" );
    
g_pCvarAmmoWIN_ZOMBIES ] = register_cvar"zombies_ammopack""5" );
}

public 
zp_round_endediTeam ) {
    if( 
iTeam == WIN_NO_ONE )
        return;
    
    new 
idiPlayers32 ], iNumiPacks get_pcvar_numg_pCvarAmmoiTeam ] );
    
get_playersiPlayersiNum"ac" );
    
    for( new 
iiNumi++ ) {
        
zp_set_user_ammo_packs( ( id iPlayers] ),
        
zp_get_user_ammo_packsid ) + iPacks );
    }

__________________

Last edited by xPaw; 09-04-2009 at 08:42.
xPaw is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-04-2009 , 08:04   Re: ammopack problem
Reply With Quote #4

PHP Code:
for( new iiNumi++ ) { 
     
zp_set_user_ammo_packsiPlayers], 
     
zp_get_user_ammo_packsiPlayers] + iPacks ) ); 

->
PHP Code:
new player;
for( new 
iiNumi++ ) { 
     
zp_set_user_ammo_packsplayer
     
zp_get_user_ammo_packs( ( player iPlayers] ) ) + iPacks ); 

SnoW is offline
Send a message via MSN to SnoW
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 09-04-2009 , 09:15   Re: ammopack problem
Reply With Quote #5

Quote:
Originally Posted by xPaw View Post
Try this
PHP Code:
#include <amxmodx>
#include <zombieplague>
 
new g_pCvarAmmo];
 
public 
plugin_init( ) {
    
register_plugin"End Round Reward""1.0""asd" );
 
    
g_pCvarAmmoWIN_HUMANS ] = register_cvar"humans_ammopack""5" );
    
g_pCvarAmmoWIN_ZOMBIES ] = register_cvar"zombies_ammopack""5" );
}
 
public 
zp_round_endediTeam ) {
    if( 
iTeam == WIN_NO_ONE )
        return;
 
    new 
idiPlayers32 ], iNumiPacks get_pcvar_numg_pCvarAmmoiTeam ] );
    
get_playersiPlayersiNum"ac" );
 
    for( new 
iiNumi++ ) {
        
zp_set_user_ammo_packs( ( id iPlayers] ),
        
zp_get_user_ammo_packsid ) + iPacks );
    }


undefined symbol "iTeam"
Mr.Noobie is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 09-04-2009 , 23:49   Re: ammopack problem
Reply With Quote #6

Quote:
Originally Posted by xPaw View Post
Try this
PHP Code:
#include <amxmodx>
#include <zombieplague>
 
new g_pCvarAmmo];
 
public 
plugin_init( ) {
    
register_plugin"End Round Reward""1.0""asd" );
 
    
g_pCvarAmmoWIN_HUMANS ] = register_cvar"humans_ammopack""5" );
    
g_pCvarAmmoWIN_ZOMBIES ] = register_cvar"zombies_ammopack""5" );
}
 
public 
zp_round_endediTeam ) {
    if( 
iTeam == WIN_NO_ONE )
        return;
 
    new 
idiPlayers32 ], iNumiPacks get_pcvar_numg_pCvarAmmoiTeam ] );
    
get_playersiPlayersiNum"ac" );
 
    for( new 
iiNumi++ ) {
        
zp_set_user_ammo_packs( ( id iPlayers] ),
        
zp_get_user_ammo_packsid ) + iPacks );
    }

Sorrry for the double posting.

Xpaw yours didnt' work correctly

I want it like this :

Example:

If the user have 3 ammo pack, his team wins. the cvar is 5 ammo pack reward.

Hes ammo pack should be 8.

Yours:

If the user have 3 ammo pack, his team wins. the cvar is 5 ammo pack reward.

Hes ammo pack is 5.
Mr.Noobie 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 15:07.


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