AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [REQ] Can someone edit this script to add bhop? (https://forums.alliedmods.net/showthread.php?t=313041)

CrazySkull2k 12-26-2018 08:09

[REQ] Can someone edit this script to add bhop?
 
Hi, I found a simple vip plugin (finally) and it lacks the bhop functionality. Does anyone here have time to add that to the script? Here it is

Code:

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <clientprefs>
#include <colors>
#include <loghelper>
#include <sdkhooks>

public Plugin:myinfo =
{
        name = "VIP Plugin",
        author = "Hanys",
        description = "vip plugin",
        version = "1.2.3",
        url = "http://hanys.net.pl"
};

new Handle:HP;
new Handle:Gravity;
new Handle:Speedy;
new Handle:Smokegrenade;
new Handle:Flashbang;
new Handle:Hegrenade;
new Handle:Molotov;
new Handle:Armorvalue;
new Handle:Bhashelmet;
new Handle:Defuser;
new Handle:Moneystart;
new Handle:Bombplanted;
new Handle:Bombdefused;
new Handle:Headshot_money;
new Handle:Headshot_hp;
new Handle:Kill_money;
new Handle:Kill_hp;
new Handle:Tagtable;
new Handle:Tagsay;
new Handle:Double_jump;

public OnPluginStart()
{
        CreateConVar("sm_vip_version", "1.2.3", "VIP Plugin", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
       
        HP = CreateConVar("vip_hp_start", "10", "Ilosc HP na start rundy", FCVAR_NOTIFY);
        Gravity = CreateConVar("vip_gravity", "1.0", "Grawitacja (1.0 - standardowa)", FCVAR_PLUGIN);
        Speedy = CreateConVar("vip_speed", "1.0", "Szybkosc biegania (1.0 - standardowo)", FCVAR_PLUGIN);
        Smokegrenade = CreateConVar("vip_smokegrenade", "0", "Smoke na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
        Flashbang = CreateConVar("vip_flashbang", "0", "Flash na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
        Hegrenade = CreateConVar("vip_hegrenade", "0", "Granat na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
        Molotov = CreateConVar ("vip_molotov", "0", "Molotov", FCVAR_NONE, true, 0.0, true, 1.0);
        Armorvalue = CreateConVar("vip_armorvalue", "0", "Kamizelka na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
        Bhashelmet = CreateConVar("vip_bhashelmet", "0", "Kask na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
        Defuser = CreateConVar("vip_defuser", "0", "Zestaw do rozbrajania dla CT na start rundy", FCVAR_NONE, true, 0.0, true, 1.0);
        Moneystart = CreateConVar("vip_money_start", "0", "Ilosc $ na start rundy", FCVAR_NOTIFY);
        Bombplanted = CreateConVar("vip_bomb_planted", "0", "Ilosc $ za podlozenie bomby", FCVAR_NOTIFY);
        Bombdefused = CreateConVar("vip_bomb_defused", "0", "Ilosc $ za rozbrojenie bomby", FCVAR_NOTIFY);
        Headshot_money = CreateConVar("vip_headshot_money", "0", "Ilosc $ za Headshot", FCVAR_NOTIFY);
        Headshot_hp = CreateConVar("vip_headshot_hp", "0", "Ilosc HP za Headshot", FCVAR_NOTIFY);
        Kill_money = CreateConVar("vip_kill_money", "0", "Ilosc $ za fraga", FCVAR_NOTIFY);
        Kill_hp = CreateConVar("vip_kill_hp", "0", "Ilosc HP za fraga", FCVAR_NOTIFY);
        Tagtable = CreateConVar("vip_tag_table", "0", "Tag VIP w tabeli wynikow", FCVAR_NONE, true, 0.0, true, 1.0);
        Tagsay = CreateConVar("vip_tag_say", "0", "Tag VIP + kolorowy nick w say", FCVAR_NONE, true, 0.0, true, 1.0);
        Double_jump = CreateConVar("vip_double_jump", "0", "Podwojny skok", FCVAR_NONE, true, 0.0, true, 1.0);
       
        AutoExecConfig(true, "sm_vip");
       
        RegConsoleCmd("say", Command_SendToAll);
        RegConsoleCmd("say_team", Command_SendToTeam);
       
        HookEvent("player_spawn", Event_OnPlayerSpawn);
        HookEvent("bomb_planted", Event_BombPlanted);
        HookEvent("bomb_defused", Event_BombDefused);
        HookEvent("player_death",  Event_PlayerDeath);
        HookEvent("player_team", Event_TagTable);
        HookEvent("player_spawn", Event_TagTable);
       
        CreateTimer(180.0, Timer_Copy, _, TIMER_REPEAT);
       
}

public Action:Timer_Copy(Handle:timer)
{
        PrintToChatAll("\x01[\x04VIP\x01]\x04 Plugin VIP by Hanys");
}


public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
        new client = GetClientOfUserId(GetEventInt(event, "userid"));
        new money = GetEntProp(client, Prop_Send, "m_iAccount");
        new team = GetClientTeam(client);
        new g_HP = GetConVarInt(HP);
        new g_moneystart = GetConVarInt(Moneystart);
       
        if (client > 0 && IsPlayerAlive(client))
       
       
        {
                if (IsPlayerGenericAdmin(client))
               
               
                {
                        SetEntityHealth(client, g_HP); //hp
                        SetEntityGravity(client, GetConVarFloat(Gravity)); //grawitacja
                        SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", GetConVarFloat(Speedy)); //predkosc biegania
                        if (GetConVarBool(Smokegrenade)) GivePlayerItem(client, "weapon_smokegrenade"); //smoke
                        if (GetConVarBool(Flashbang)) GivePlayerItem(client, "weapon_flashbang"); //flash
                        if (GetConVarBool(Flashbang)) GivePlayerItem(client, "weapon_flashbang"); //flash
                        if (GetConVarBool (Molotov) ) GivePlayerItem(client, "weapon_molotov"); //molotov
                        if (GetConVarBool(Hegrenade)) GivePlayerItem(client, "weapon_hegrenade"); //grenade
                       
                        SetEntProp(client, Prop_Send, "m_iAccount", money + g_moneystart); // plus $ na start
                        if (GetConVarBool(Armorvalue)) SetEntProp(client, Prop_Send, "m_ArmorValue", 100); //kamizelka
                        if (GetConVarBool(Bhashelmet)) SetEntProp(client, Prop_Send, "m_bHasHelmet", 1); //helm
                       
                        if(team == CS_TEAM_CT)
                       
                       
                        {
                                if (GetConVarBool(Defuser)) GivePlayerItem(client, "item_defuser"); //kombinerki
                               
                               
                        }
                       
                       
                       
                       
                }
               
               
        }
}

public Event_BombPlanted(Handle:event, const String:name[], bool:dontBroadcast)
{
        new client = GetClientOfUserId(GetEventInt(event, "userid"));
        new money = GetEntProp(client, Prop_Send, "m_iAccount");
        new g_bombplanted = GetConVarInt(Bombplanted);
       
        if (IsPlayerGenericAdmin(client))
       
       
        {
                SetEntProp(client, Prop_Send, "m_iAccount", money + g_bombplanted);//plus $ for Bomb Planted
               
               
        }
}

public Event_BombDefused(Handle:event, const String:name[], bool:dontBroadcast)
{
        new client = GetClientOfUserId(GetEventInt(event, "userid"));
        new money = GetEntProp(client, Prop_Send, "m_iAccount");
        new g_bombdefused = GetConVarInt(Bombdefused);
       
        if (IsPlayerGenericAdmin(client))
       
       
        {
                SetEntProp(client, Prop_Send, "m_iAccount", money + g_bombdefused); //plus $ for Bomb Defused
               
               
        }
}

public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
        new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
        new money = GetEntProp(attacker, Prop_Send, "m_iAccount");
        new health = GetEntProp(attacker, Prop_Send, "m_iHealth");
        new g_headshot_money = GetConVarInt(Headshot_money);
        new g_headshot_hp = GetConVarInt(Headshot_hp);
        new g_kill_money = GetConVarInt(Kill_money);
        new g_kill_hp = GetConVarInt(Kill_hp);
       
        new bool:headshot = GetEventBool(event, "headshot");
        if (IsPlayerGenericAdmin(attacker))
       
       
        {
                if(headshot)
               
                {
                        SetEntProp(attacker, Prop_Send, "m_iAccount", money + g_headshot_money); //plus for hs
                        SetEntProp(attacker, Prop_Send, "m_iHealth", health + g_headshot_hp); //plus hp for hs
                       
                       
                }
                else
               
                {
                        SetEntProp(attacker, Prop_Send, "m_iAccount", money + g_kill_money); //plus for kill
                        SetEntProp(attacker, Prop_Send, "m_iHealth", health + g_kill_hp); //plus hp for kill
                       
                       
                }
               
               
        }
}

public Action:Event_TagTable(Handle:event, String:name[], bool:dontBroadcast)
{
        new client = GetClientOfUserId(GetEventInt(event, "userid"));
        if (IsPlayerGenericAdmin(client))
       
       
        {
                if (GetConVarBool(Tagtable)) CS_SetClientClanTag(client, "[VIP]");
               
               
        }
}

public Action:Command_SendToAll(client, args)
{
        if ((IsPlayerGenericAdmin(client)) && GetConVarBool(Tagsay))
       
       
        {
                decl String:sTextToAll[1024];
                GetCmdArgString(sTextToAll, sizeof(sTextToAll));
                StripQuotes(sTextToAll);
                LogPlayerEvent(client, "say=", sTextToAll);
               
                new team = GetClientTeam(client);
               
                if(sTextToAll[0] != '@' && sTextToAll[0] != '/' && sTextToAll[0] != '!' && sTextToAll[0] > 0)
               
               
                {
                        if(IsPlayerAlive(client) && team == 2 || team == 3)
                       
                       
                        {
                                PrintToChatAll("\x01[\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
                               
                               
                        }
                        /* Player isn't alive and have team (no spec) */
                        else if(!IsPlayerAlive(client) && team == 2 || team == 3)
                       
                       
                        {
                                PrintToChatAll("\x01*NIE ŻYJE* [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
                               
                               
                        }
                        /* Player is in spectate */
                        else if(!IsPlayerAlive(client) && team != 2 && team != 3)
                       
                       
                        {
                                PrintToChatAll("\x01*OBSERWATOR* [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
                               
                               
                        }
                       
                       
                }
               
                return Plugin_Handled;
               
               
        }
       
        return Plugin_Continue;
}

public Action:Command_SendToTeam(client, args)
{
       
        if ((IsPlayerGenericAdmin(client)) && GetConVarBool(Tagsay))
       
       
        {
                decl String:sTextToAll[1024];
                GetCmdArgString(sTextToAll, sizeof(sTextToAll));
                StripQuotes(sTextToAll);
                LogPlayerEvent(client, "say=", sTextToAll);
               
                new team = GetClientTeam(client);
               
                if(IsPlayerAlive(client) && team == 2 || team == 3)
               
               
                {
                        for(new i = 1; i <= MaxClients; i++)
                       
                       
                        {
                                if(IsClientInGame(i) && sTextToAll[0] != '@' && sTextToAll[0] != '/' && sTextToAll[0] != '!')
                               
                               
                                {
                                        new PlayersTeam = GetClientTeam(i);
                                        if(PlayersTeam & team && sTextToAll[0] > 0)
                                       
                                       
                                        {
                                                if(team == 2)
                                                PrintToChat(i, "\x01(Terrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
                                                else
                                                PrintToChat(i, "\x01(Antyterrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
                                               
                                               
                                        }
                                       
                                       
                                }
                               
                               
                        }
                       
                       
                }
                /* Player isn't alive and have team (no spec) */
                else if(!IsPlayerAlive(client) && team == 2 || team == 3 && sTextToAll[0] != '@' && sTextToAll[0] != '/' && sTextToAll[0] != '!')
               
               
                {
                        for(new i = 1; i <= MaxClients; i++)
                       
                       
                        {
                                if(IsClientInGame(i) && !IsPlayerAlive(i))
                               
                               
                                {
                                        new PlayersTeam = GetClientTeam(i);
                                        if(PlayersTeam & team && sTextToAll[0] > 0)
                                       
                                       
                                        {
                                                if(team == 2)
                                                PrintToChat(i, "\x01*NIE ŻYJE*(Terrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
                                                else
                                                PrintToChat(i, "\x01*NIE ŻYJE*(Antyterrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
                                               
                                               
                                        }
                                       
                                       
                                }
                               
                               
                        }
                       
                       
                }
                /* Player is in spectate */
                else if(!IsPlayerAlive(client) && team != 2 && team != 3 && sTextToAll[0] != '@' && sTextToAll[0] != '/' && sTextToAll[0] != '!')
               
               
                {
                        for(new i = 1; i <= MaxClients; i++)
                       
                       
                        {
                                if(IsClientInGame(i) && !IsPlayerAlive(i))
                               
                               
                                {
                                        new PlayersTeam = GetClientTeam(i);
                                        if(PlayersTeam & team && sTextToAll[0] > 0)
                                       
                                       
                                        {
                                                if(team == 2)
                                                PrintToChat(i, "\x01*OBSERWATOR*(Terrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
                                                else
                                                PrintToChat(i, "\x01*OBSERWATOR*(Antyterrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
                                               
                                               
                                        }
                                       
                                       
                                }
                               
                               
                        }
                       
                       
                }
               
                return Plugin_Handled;
               
               
        }
       
        return Plugin_Continue;
}

public Action:OnPlayerRunCmd(iClient, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
        if ((IsPlayerGenericAdmin(iClient)) && IsPlayerAlive(iClient) && GetConVarBool(Double_jump))
       
       
        {
                static g_fLastButtons[MAXPLAYERS+1], g_fLastFlags[MAXPLAYERS+1], g_iJumps[MAXPLAYERS+1], fCurFlags, fCurButtons;
                fCurFlags = GetEntityFlags(iClient);
                fCurButtons = GetClientButtons(iClient);
                if (g_fLastFlags[iClient] & FL_ONGROUND && !(fCurFlags & FL_ONGROUND) && !(g_fLastButtons[iClient] & IN_JUMP) && fCurButtons & IN_JUMP) g_iJumps[iClient]++;
                else if(fCurFlags & FL_ONGROUND) g_iJumps[iClient] = 0;
                else if(!(g_fLastButtons[iClient] & IN_JUMP) && fCurButtons & IN_JUMP && g_iJumps[iClient] == 1)
               
               
                {
                        g_iJumps[iClient]++;
                        decl Float:vVel[3];
                        GetEntPropVector(iClient, Prop_Data, "m_vecVelocity", vVel);
                        vVel[2] = 250.0;
                        TeleportEntity(iClient, NULL_VECTOR, NULL_VECTOR, vVel);
                       
                       
                }
               
                g_fLastFlags[iClient] = fCurFlags;
                g_fLastButtons[iClient] = fCurButtons;
               
               
        }
        return Plugin_Continue;
}

/*
@param client id

return bool
*/
bool:IsPlayerGenericAdmin(client)
{
        if (!CheckCommandAccess(client, "sm_vip", 0, true)) return false;
       
       
        {
                return true;
               
               
        }
}



All times are GMT -4. The time now is 05:41.

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