AlliedModders

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

emaya93 07-02-2012 16:25

Editing plugin
 
I want to put in this plugin time to start, and to end.. This is a plugin:
Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

const MAX_PLAYERS = 32;

new g_iRespawn[MAX_PLAYERS+1], g_TeamInfoCounter[MAX_PLAYERS+1], CsTeams:g_iPlayerTeam[MAX_PLAYERS+1];
new g_pCvarRespawnTime, g_pCvarRespawnDelay, g_pCvarMaxHealth;

public plugin_init()
{
    register_plugin("Respawn Times", "0.0.1", "iBrazilian");
   
    RegisterHam(Ham_Killed, "player", "fwdPlayerKilledPost", 1);
    RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawnPost", 1);
    register_event("TeamInfo", "eTeamInfo", "a");
    g_pCvarRespawnTime = register_cvar("amx_respawn_tickets", "30"); //Set to 0 for unlimited respawns
    g_pCvarRespawnDelay = register_cvar("amx_respawn_delay", "3");
    g_pCvarMaxHealth = register_cvar("amx_max_health", "100");
    set_msg_block( get_user_msgid( "ClCorpse" ), BLOCK_SET );
}

public fwdPlayerKilledPost(iVictim, iKiller, iShoudlGib)
{
    if(g_iRespawn[iVictim]++ < get_pcvar_num(g_pCvarRespawnTime) || get_pcvar_num(g_pCvarRespawnTime) == 0)
    {
        set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer", iVictim);
    }
    return HAM_IGNORED;
}

public fwdPlayerSpawnPost(iClient)
{
    if(is_user_alive(iClient))
    {
        set_pev(iClient, pev_health, get_pcvar_float(g_pCvarMaxHealth));
    }
}

public taskRespawnPlayer(id)
{
    if(is_user_connected(id) && !is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {
        ExecuteHamB(Ham_CS_RoundRespawn, id)
        return PLUGIN_HANDLED;
    }
    return PLUGIN_HANDLED;


public eTeamInfo()
{
    new iClient = read_data(1);
    new szTeam[2];
    read_data(2, szTeam, charsmax(szTeam));
    switch(szTeam[0])
    {
        case 'T':
        {
            if(g_TeamInfoCounter[iClient] == 2 || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
            {
                set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer",  iClient);
            }
            g_iPlayerTeam[iClient] = CS_TEAM_T;
        }
        case 'C':
        {
            if(g_TeamInfoCounter[iClient] == 2 || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
            {
                set_task(get_pcvar_float(g_pCvarRespawnDelay), "taskRespawnPlayer",  iClient);
            }
            g_iPlayerTeam[iClient] = CS_TEAM_CT;
        }
        case 'S':
        {
            remove_task(iClient);
            g_iPlayerTeam[iClient] = CS_TEAM_SPECTATOR;
        }
    }
}

And i want to put in, something like that... i try to put my self but not works..

Code:

new Float:RoundStartTime
#define TIME_INTERVAL  30.0

Wen the round start this plugin to be active for 30 second's, after 30 seconds to stop. And new round new 30 seconds to respawn. Thanks

Liverwiz 07-02-2012 22:38

Re: Editing plugin
 
You have one of two choices.

1. Check this out: http://www.amxmodx.org/funcwiki.php?go=func&id=253
2. or check this out: http://forums.alliedmods.net/forumdisplay.php?f=12

Whichever way you do it i hope you learn something. ;)

emaya93 07-03-2012 07:03

Re: Editing plugin
 
Work thanks :D somethig new..

Liverwiz 07-03-2012 10:30

Re: Editing plugin
 
Quote:

Originally Posted by emaya93 (Post 1742019)
Work thanks :D somethig new..

HOLY CRAP! You actually DIDN'T beg me to do it FOR you?
+karma

emaya93 07-03-2012 13:34

Re: Editing plugin
 
i learn fast...
Off.T.
I have a question, what mean "+karma", i see somethinc on wiki... but i am not totally convinced

Exolent[jNr] 07-03-2012 13:37

Re: Editing plugin
 
Karma no longer exists on this forum. Now, it is just a theoretical karma you get.

Liverwiz 07-03-2012 16:04

Re: Editing plugin
 
Quote:

Originally Posted by emaya93 (Post 1742378)
i learn fast...
Off.T.
I have a question, what mean "+karma", i see somethinc on wiki... but i am not totally convinced

It means you've done well.

fysiks 07-03-2012 19:21

Re: Editing plugin
 
Quote:

Originally Posted by Exolent[jNr] (Post 1742385)
Karma no longer exists on this forum. Now, it is just a theoretical karma you get.

It's real karma! Not that fake stuff we used to have on the forums lol.

emaya93 07-04-2012 06:25

Re: Editing plugin
 
Thanks :D


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

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