Raised This Month: $ Target: $400
 0% 

Editing plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
emaya93
Member
Join Date: Jun 2012
Old 07-02-2012 , 16:25   Editing plugin
Reply With Quote #1

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
emaya93 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-02-2012 , 22:38   Re: Editing plugin
Reply With Quote #2

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. ;)
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
emaya93
Member
Join Date: Jun 2012
Old 07-03-2012 , 07:03   Re: Editing plugin
Reply With Quote #3

Work thanks somethig new..

Last edited by emaya93; 07-03-2012 at 07:04.
emaya93 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-03-2012 , 10:30   Re: Editing plugin
Reply With Quote #4

Quote:
Originally Posted by emaya93 View Post
Work thanks somethig new..
HOLY CRAP! You actually DIDN'T beg me to do it FOR you?
+karma
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
emaya93
Member
Join Date: Jun 2012
Old 07-03-2012 , 13:34   Re: Editing plugin
Reply With Quote #5

i learn fast...
Off.T.
I have a question, what mean "+karma", i see somethinc on wiki... but i am not totally convinced
emaya93 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-03-2012 , 13:37   Re: Editing plugin
Reply With Quote #6

Karma no longer exists on this forum. Now, it is just a theoretical karma you get.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-03-2012 , 16:04   Re: Editing plugin
Reply With Quote #7

Quote:
Originally Posted by emaya93 View Post
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.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-03-2012 , 19:21   Re: Editing plugin
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
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.
__________________
fysiks is offline
emaya93
Member
Join Date: Jun 2012
Old 07-04-2012 , 06:25   Re: Editing plugin
Reply With Quote #9

Thanks
emaya93 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:17.


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