AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   ammopack problem (https://forums.alliedmods.net/showthread.php?t=102105)

Mr.Noobie 08-30-2009 03:12

ammopack problem
 
I have a problem with this plugin. I want nemesis to earn ammo pack for 1 kill same goes to survivor.

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
    attacker 
read_data)
 
    if ( !
zp_get_user_survivorattacker ) )
        return;
    if ( !
zp_get_user_nemesisattacker ) )
        return;
 
    
zp_set_user_ammo_packsattackerzp_get_user_ammo_packsattacker ) + )


I know it won't work because both attacker is the same but i try this also didn't work.

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
    
static attacker2
    attacker 
read_data)
    
attacker2 read_data)
 
    if ( !
zp_get_user_survivorattacker ) )
        return;
    if ( !
zp_get_user_nemesisattacker2 ) )
        return;
 
    
zp_set_user_ammo_packsattackerzp_get_user_ammo_packsattacker ) + )
    
zp_set_user_ammo_packsattacker2zp_get_user_ammo_packsattacker2 ) + )



Mr.Noobie 09-03-2009 12:07

Re: ammopack problem
 
Help please :(

Exolent[jNr] 09-03-2009 12:13

Re: ammopack problem
 
Don't bump until 2 weeks have passed since last post.

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
    attacker 
read_data)
 
    if ( !
zp_get_user_survivorattacker ) && !zp_get_user_nemesisattacker ) )
        return;
 
    
zp_set_user_ammo_packsattackerzp_get_user_ammo_packsattacker ) + )



xPaw 09-03-2009 12:53

Re: ammopack problem
 
PHP Code:

if ( !zp_get_user_survivorattacker ) && !zp_get_user_nemesisread_data) ) ) 


Exolent[jNr] 09-03-2009 12:58

Re: ammopack problem
 
Quote:

Originally Posted by xPaw (Post 921913)
...

I don't know zombie plague scripting enough to know the difference between a nemesis and a survivor.

SnoW 09-03-2009 13:14

Re: ammopack problem
 
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 ) + )



Mr.Noobie 09-04-2009 06:16

Re: ammopack problem
 
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

xPaw 09-04-2009 07:13

Re: ammopack problem
 
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 );
    }



SnoW 09-04-2009 08:04

Re: ammopack problem
 
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 ); 



xPaw 09-04-2009 08:42

Re: ammopack problem
 
Thats wrong snow.. I mean with player


All times are GMT -4. The time now is 15:07.

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