- #include <sourcemod>
- #include <cstrike>
- #include <sdktools>
- #pragma semicolon 1
- #pragma newdecls required
- public Plugin myinfo =
- {
- name = "[CS:GO] VIP",
- author = "xBonio & Avgariat & Vasto_Lorde",
- description = "VIP Generator by cs-plugin.com",
- version = "1.0",
- url = "http://cs-plugin.com"
- };
- char tag[64] = "";
- int offsetHe;
- int offsetFlash;
- int offsetSmoke;
- int offsetInc;
- int offsetMol;
- int offsetDecoy;
- int offsetTa;
- int offsetHealth;
- public void OnPluginStart()
- {
- HookEvent("player_spawn", PlayerSpawn);
- HookEvent("player_death", PlayerDeath);
- }
- public void OnMapStart()
- {
- int entindex;
- entindex = CreateEntityByName("weapon_hegrenade");
- DispatchSpawn(entindex);
- offsetHe = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
- AcceptEntityInput(entindex, "Kill");
- entindex = CreateEntityByName("weapon_flashbang");
- DispatchSpawn(entindex);
- offsetFlash = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
- AcceptEntityInput(entindex, "Kill");
- entindex = CreateEntityByName("weapon_smokegrenade");
- DispatchSpawn(entindex);
- offsetSmoke = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
- AcceptEntityInput(entindex, "Kill");
- entindex = CreateEntityByName("weapon_incgrenade");
- DispatchSpawn(entindex);
- offsetInc = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
- AcceptEntityInput(entindex, "Kill");
- entindex = CreateEntityByName("weapon_molotov");
- DispatchSpawn(entindex);
- offsetMol = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
- AcceptEntityInput(entindex, "Kill");
- entindex = CreateEntityByName("weapon_decoy");
- DispatchSpawn(entindex);
- offsetDecoy = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
- AcceptEntityInput(entindex, "Kill");
- entindex = CreateEntityByName("weapon_tagrenade");
- DispatchSpawn(entindex);
- offsetTa = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
- AcceptEntityInput(entindex, "Kill");
- entindex = CreateEntityByName("weapon_healthshot");
- DispatchSpawn(entindex);
- offsetHealth = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
- AcceptEntityInput(entindex, "Kill");
- }
- public Action PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(GetEventInt(event, "userid"));
- if(!IsPlayerVIP(client)) return;
- SetEntProp(client, Prop_Send, "m_ArmorValue", 650);
- if(GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != 0)
- SetEntProp(client, Prop_Send, "m_bHasHelmet", 1);
- SetEntityHealth(client, 110);
- int money = GetEntProp(client, Prop_Send, "m_iAccount");
- SetEntProp(client, Prop_Send, "m_iAccount", money+200);
- if(GetClientTeam(client) == CS_TEAM_CT)
- if(GetEntProp(client, Prop_Send, "m_bHasDefuser") == 0) GivePlayerItem(client, "item_defuser");
- for(int x = 0; x < 1; x++)
- if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHe) < 1) GivePlayerItem(client, "weapon_hegrenade");
- for(int x = 0; x < 1; x++)
- if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetFlash) < 1) GivePlayerItem(client, "weapon_flashbang");
- for(int x = 0; x < 1; x++)
- if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetSmoke) < 1) GivePlayerItem(client, "weapon_smokegrenade");
- if(GetClientTeam(client) == CS_TEAM_CT)
- {
- for(int x = 0; x < ; x++) // ilosc inc
- if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetInc) < ) GivePlayerItem(client, "weapon_incgrenade");
- }
- else if(GetClientTeam(client) == CS_TEAM_T)
- {
- for(int x = 0; x < ; x++)
- if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetMol) < ) GivePlayerItem(client, "weapon_molotov");
- }
- for(int x = 0; x < ; x++)
- if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetDecoy) < ) GivePlayerItem(client, "weapon_decoy");
- for(int x = 0; x < ; x++)
- if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetTa) < ) GivePlayerItem(client, "weapon_tagrenade");
- for(int x = 0; x < ; x++)
- if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHealth) < ) GivePlayerItem(client, "weapon_healthshot");
- }
- public Action PlayerDeath(Handle event, const char[] name, bool dontBroadcast)
- {
- int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
- if(!IsValidPlayer(attacker) || !IsPlayerVIP(attacker)) return;
- int health = GetClientHealth(attacker);
- SetEntityHealth(attacker, health+5);
- bool headshot = GetEventBool(event, "headshot", false);
- if(headshot)
- {
- health = GetClientHealth(attacker);
- SetEntityHealth(attacker, health+10);
- }
- if(GetClientHealth(attacker) > 130)
- SetEntityHealth(attacker, 130);
- }
- public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float[3] vel, float[3] angles, int &weapon)
- {
- if(!IsValidPlayer(client) || !IsPlayerAlive(client)) return;
- if(!IsPlayerVIP(client)) return;
- static int g_fLastButtons[MAXPLAYERS+1], g_fLastFlags[MAXPLAYERS+1], g_iJumps[MAXPLAYERS+1], fCurFlags, fCurButtons;
- fCurFlags = GetEntityFlags(client);
- fCurButtons = GetClientButtons(client);
- if (g_fLastFlags[client] & FL_ONGROUND && !(fCurFlags & FL_ONGROUND) && !(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP) g_iJumps[client]++;
- else if(fCurFlags & FL_ONGROUND) g_iJumps[client] = 0;
- else if(!(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP && g_iJumps[client] <= 3)
- {
- g_iJumps[client]++;
- float vVel[3];
- GetEntPropVector(client, Prop_Data, "m_vecVelocity", vVel);
- vVel[2] = 250.0;
- TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vVel);
- }
- g_fLastFlags[client] = fCurFlags;
- g_fLastButtons[client] = fCurButtons;
- }
- stock bool IsValidPlayer(int client)
- {
- if(client >= 1 && client <= MaxClients && IsClientInGame(client) && !IsFakeClient(client) && !IsClientSourceTV(client))
- return true;
- return false;
- }
- stock bool IsPlayerVIP(int client)
- {
- if(GetUserFlagBits(client) & ADMFLAG_CUSTOM4)
- return true;
- return false;
- }