AlliedModders

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

zombieplague 11-20-2009 21:54

Level
 
I having problem with this plugin.

PHP Code:

#include <amxmodx> 
#include <fun>

new MyGlobalVar33 ]

public 
plugin_init( ) 
{
        
register_plugin"kills level""1.0""ASD" )
        
register_event"DeathMsg""Event_PlayerKilled""a" )
}

public 
Event_PlayerKilled( )
{
     new 
Killer read_data)
     
MyGlobalVarKiller ]++;

     if ( 
MyGlobalVarKiller ] == )
     {
          
give_itemKiller"weapon_hegrenade" )
     }

     if ( 
MyGlobalVarKiller ] == )
     {
          
give_itemKiller"weapon_ak47" )
     }

     if ( 
MyGlobalVarKiller ] == )
     {
          
give_itemKiller"weapon_m4a1" )
     } 


Like the plugin say if the user score is 1/k he get a grenade.

But i want every 1 kill user get a grenade. even if his score is 5k

Exolent[jNr] 11-20-2009 22:22

Re: Level
 
PHP Code:

#include <amxmodx> 
#include <fun>

#define GRENADE_INTERVAL 1
#define AK47_INTERVAL 2
#define M4A1_INTERVAL 3

new MyGlobalVar33 ]

public 
plugin_init( ) 
{
        
register_plugin"kills level""1.0""ASD" )
        
register_event"DeathMsg""Event_PlayerKilled""a" )
}

public 
Event_PlayerKilled( )
{
     new 
Killer read_data)
     
MyGlobalVarKiller ]++;

     if ( 
MyGlobalVarKiller ] % == // not necessary for an if statement since this will always be true since ANYTHING % 1 always equals 0
     
{
          
give_itemKiller"weapon_hegrenade" )
     }

     if ( 
MyGlobalVarKiller ] % == )
     {
          
give_itemKiller"weapon_ak47" )
     }

     if ( 
MyGlobalVarKiller ] % == )
     {
          
give_itemKiller"weapon_m4a1" )
     } 



zombieplague 11-20-2009 22:57

Re: Level
 
Quote:

Originally Posted by Exolent[jNr] (Post 994582)
PHP Code:

#include <amxmodx> 
#include <fun>
 
#define GRENADE_INTERVAL 1
#define AK47_INTERVAL 2
#define M4A1_INTERVAL 3
 
new MyGlobalVar33 ]
 
public 
plugin_init( ) 
{
        
register_plugin"kills level""1.0""ASD" )
        
register_event"DeathMsg""Event_PlayerKilled""a" )
}
 
public 
Event_PlayerKilled( )
{
     new 
Killer read_data)
     
MyGlobalVarKiller ]++;
 
     if ( 
MyGlobalVarKiller ] % == // not necessary for an if statement since this will always be true since ANYTHING % 1 always equals 0
     
{
          
give_itemKiller"weapon_hegrenade" )
     }
 
     if ( 
MyGlobalVarKiller ] % == )
     {
          
give_itemKiller"weapon_ak47" )
     }
 
     if ( 
MyGlobalVarKiller ] % == )
     {
          
give_itemKiller"weapon_m4a1" )
     } 



I was trying to do a skill. But how do i make it stop functioning when it reach to 3 kills ?

zombieplague 11-25-2009 01:39

Re: Level
 
How can i stop functioning when it reach it target ?

remove task ?


All times are GMT -4. The time now is 13:38.

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