Raised This Month: $51 Target: $400
 12% 

[CS GO] plugin help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 03-09-2015 , 06:01   [CS GO] plugin help
Reply With Quote #1

After [time left] expires map no change....Can fixed someone this?

Code:
#include <cstrike>
#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
    HookEvent("player_connect_full", Event_OnFullConnect, EventHookMode_Pre);
    HookEvent("cs_match_end_restart", Event_OnMatchRestart, EventHookMode_Pre);
    HookEvent("player_team", Event_OnPlayerTeam, EventHookMode_Pre);
    HookEvent("player_death", Event_OnPlayerDeath, EventHookMode_Pre);
    AddCommandListener(Command_Join, "jointeam");
}

public Action:Event_OnFullConnect(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(!client || !IsClientInGame(client))
        return Plugin_Continue;

    new iRed, iBlue;
    for(new i = 1; i <= MaxClients; i++)
    {
        if(!IsClientInGame(i))
            continue;

        new iTeam = GetClientTeam(i);
        if(iTeam == CS_TEAM_T)
            iRed++;
        else if(iTeam == CS_TEAM_CT)
            iBlue++;
    }

    if(iRed < iBlue)
        SetEntProp(client, Prop_Send, "m_iTeamNum", CS_TEAM_T);
    else
        SetEntProp(client, Prop_Send, "m_iTeamNum", CS_TEAM_CT);

    ForcePlayerSuicide(client);
    CS_RespawnPlayer(client);
    return Plugin_Continue;
}

public Action:Event_OnMatchRestart(Handle:event, const String:name[], bool:dontBroadcast)
{
    new iRed, iBlue, iJoin;
    for(new i = 1; i <= MaxClients; i++)
    {
        if(!IsClientInGame(i))
            continue;

        switch(GetClientTeam(i))
        {
            case CS_TEAM_T:
                iRed++;
            case CS_TEAM_CT:
                iBlue++;
        }
    }

    for(new i = 1; i <= MaxClients; i++)
    {
        if(!IsClientInGame(i))
            continue;

        if(iRed < iBlue)
            iJoin = CS_TEAM_T;
        else if(iBlue < iRed)
            iJoin = CS_TEAM_CT;
        else
            iJoin = GetRandomInt(CS_TEAM_T, CS_TEAM_CT);

        switch(iJoin)
        {
            case CS_TEAM_T:
                iRed++;
            case CS_TEAM_CT:
                iBlue++;
        }

        ChangeClientTeam(i, iJoin);
    }
}

public Action:Event_OnPlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(!client || !IsClientInGame(client))
        return Plugin_Continue;

    if(!IsPlayerAlive(client))
        CreateTimer(0.1, Timer_Respawn, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);
    return Plugin_Continue;
}

public Action:Timer_Respawn(Handle:timer, any:userid)
{
    new client = GetClientOfUserId(userid);
    if(!client)
        return Plugin_Continue;

    new iTeam = GetClientTeam(client);
    if(iTeam <= CS_TEAM_SPECTATOR)
        return Plugin_Continue;

    if(IsPlayerAlive(client))
        return Plugin_Continue;

    CS_RespawnPlayer(client);

    return Plugin_Continue;
}

public Action:Command_Join(client, const String:command[], argc)
{
    decl String:sJoining[8];
    GetCmdArg(1, sJoining, sizeof(sJoining));
    new iJoining = StringToInt(sJoining);
    if(iJoining == CS_TEAM_SPECTATOR)
        return Plugin_Continue;

    new iTeam = GetClientTeam(client);
    if(iJoining == iTeam)
        return Plugin_Handled;
    else
    {
        SetEntProp(client, Prop_Send, "m_iTeamNum", iJoining);
        ForcePlayerSuicide(client);
        CS_RespawnPlayer(client);
    }

    return Plugin_Continue;
}


public Action:Event_OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(!client || !IsClientInGame(client))
        return Plugin_Continue;

    CreateTimer(0.1, Timer_Respawn, GetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);

    return Plugin_Continue;
}

Last edited by raizo11; 03-09-2015 at 06:05.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 03-09-2015 , 09:23   Re: [CS GO] plugin help
Reply With Quote #2

Can someone enable roundtime ?
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-09-2015 , 14:57   Re: [CS GO] plugin help
Reply With Quote #3

Replied to your other post about this IM assuming just add me on Steam
Steam link is in my sig
__________________
Need help with something regarding your plugin? Or want a new plugin made? For free!!?!?!?!??!? Click HERE! I will do nearly any request <3 If I post in scripting and I resolve and don't post how just shoot me a pm linking me the thread and I will update
Brrdy is offline
nguyenbaodanh
AlliedModders Donor
Join Date: Jun 2007
Location: HCMC, Vietnam
Old 03-12-2015 , 23:12   Re: [CS GO] plugin help
Reply With Quote #4

I got this problem too ... need a fix
__________________
nguyenbaodanh is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 03-13-2015 , 10:14   Re: [CS GO] plugin help
Reply With Quote #5

Brrdy I follow your posts....You have many posts and no solution....

Last edited by raizo11; 03-26-2015 at 09:11.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 03-26-2015 , 09:11   Re: [CS GO] plugin help
Reply With Quote #6

Bump!
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
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 02:58.


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