AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need help finnishing godmode plugin (https://forums.alliedmods.net/showthread.php?t=83770)

Frogstomp 01-14-2009 23:50

need help finnishing godmode plugin
 
ok i have this
Code:

//GodMode Reward
//Alpha - NOT tested

//Included Modules
#include <amxmodx>
#include <fakemeta_util>
#include <amxmisc>
#include <fun>

//Definitions
#define PLUGIN "GodMode Reward"
#define VERSION "0.1"
#define AUTHOR "Andyz0r" //Based on hleV's Grenade Reward Plugin
#define MAX_PLAYERS 32

//New Variables
new g_iKills[MAX_PLAYERS + 1];
new g_pcvarKills;

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR);
       
        g_pcvarKills = register_cvar("amx_gmr_kills", "10");
         
        register_cvar("amx_gmr_enable", "0");
        register_event("DeathMsg", "eventDeathMsg", "a");
        register_clcmd("fullupdate", "clcmd_fullupdate")
        set_task(900.0, "creditdonotdelete"); 
}

public creditdonotdelete()
{
    if(get_cvar_num("amx_gmr_enable") == 1)
    {
    client_print(0, print_chat, "You Have Been Awarded GODMODE!")
    }
}
 
public eventDeathMsg()
{
        if (!get_pcvar_num(g_pcvarKills))
                return;
 
        new iKiller = read_data(1);
 
        if (iKiller == read_data(2))
                return;
       
        if(get_cvar_num("amx_gmr_enable") == 1)
        {
       
        new iKills = get_pcvar_num(g_pcvarKills);
        g_iKills[iKiller]++
 
        if (g_iKills[iKiller] == iKills)
        {
        //set_task(0.1, "protect", iKiller)
        set_user_godmode(iKiller, 1)
        }
       
        }
}

public clcmd_fullupdate(id)
{
  return PLUGIN_HANDLED
}

public client_putinserver(id)
{
    set_user_godmode(id, 0)
}

it compiles it just doesn't give godmode after the 10 kills or at all can someone help me finnish it

Exolent[jNr] 01-15-2009 12:24

Re: need help finnishing godmode plugin
 
How should this plugin work exactly?

Frogstomp 01-15-2009 17:14

Re: need help finnishing godmode plugin
 
well you gain 10 kills and you recieve godmode for say 10 seconds


All times are GMT -4. The time now is 01:46.

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