Facebook
From x, 6 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 169
  1. #include <sourcemod>
  2. #include <cstrike>
  3. #include <sdktools>
  4.  
  5. #pragma semicolon 1
  6. #pragma newdecls required
  7.  
  8. public Plugin myinfo =
  9. {
  10.         name = "[CS:GO] VIP",
  11.         author = "xBonio & Avgariat & Vasto_Lorde",
  12.         description = "VIP Generator by cs-plugin.com",
  13.         version = "1.0",
  14.         url = "http://cs-plugin.com"
  15. };
  16.  
  17. char tag[64] = "";
  18.  
  19. int offsetHe;
  20. int offsetFlash;
  21. int offsetSmoke;
  22. int offsetInc;
  23. int offsetMol;
  24. int offsetDecoy;
  25. int offsetTa;
  26. int offsetHealth;
  27. public void OnPluginStart()
  28. {
  29.         HookEvent("player_spawn", PlayerSpawn);
  30.         HookEvent("player_death", PlayerDeath);
  31. }
  32. public void OnMapStart()
  33. {
  34.         int entindex;
  35.  
  36.         entindex = CreateEntityByName("weapon_hegrenade");
  37.         DispatchSpawn(entindex);
  38.         offsetHe = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
  39.         AcceptEntityInput(entindex, "Kill");
  40.  
  41.         entindex = CreateEntityByName("weapon_flashbang");
  42.         DispatchSpawn(entindex);
  43.         offsetFlash = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
  44.         AcceptEntityInput(entindex, "Kill");
  45.  
  46.         entindex = CreateEntityByName("weapon_smokegrenade");
  47.         DispatchSpawn(entindex);
  48.         offsetSmoke = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
  49.         AcceptEntityInput(entindex, "Kill");
  50.  
  51.         entindex = CreateEntityByName("weapon_incgrenade");
  52.         DispatchSpawn(entindex);
  53.         offsetInc = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
  54.         AcceptEntityInput(entindex, "Kill");
  55.        
  56.         entindex = CreateEntityByName("weapon_molotov");
  57.         DispatchSpawn(entindex);
  58.         offsetMol = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
  59.         AcceptEntityInput(entindex, "Kill");
  60.  
  61.         entindex = CreateEntityByName("weapon_decoy");
  62.         DispatchSpawn(entindex);
  63.         offsetDecoy = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
  64.         AcceptEntityInput(entindex, "Kill");
  65.  
  66.         entindex = CreateEntityByName("weapon_tagrenade");
  67.         DispatchSpawn(entindex);
  68.         offsetTa = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
  69.         AcceptEntityInput(entindex, "Kill");
  70.  
  71.         entindex = CreateEntityByName("weapon_healthshot");
  72.         DispatchSpawn(entindex);
  73.         offsetHealth = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
  74.         AcceptEntityInput(entindex, "Kill");
  75. }
  76.  
  77. public Action PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
  78. {
  79.         int client = GetClientOfUserId(GetEventInt(event, "userid"));
  80.         if(!IsPlayerVIP(client)) return;
  81.         SetEntProp(client, Prop_Send, "m_ArmorValue", 650);
  82.         if(GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != 0)
  83.                 SetEntProp(client, Prop_Send, "m_bHasHelmet", 1);
  84.         SetEntityHealth(client, 110);
  85.         int money = GetEntProp(client, Prop_Send, "m_iAccount");
  86.         SetEntProp(client, Prop_Send, "m_iAccount", money+200);
  87.         if(GetClientTeam(client) == CS_TEAM_CT)
  88.                 if(GetEntProp(client, Prop_Send, "m_bHasDefuser") == 0) GivePlayerItem(client, "item_defuser");
  89.         for(int x = 0; x < 1; x++)
  90.                 if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHe) < 1) GivePlayerItem(client, "weapon_hegrenade");
  91.         for(int x = 0; x < 1; x++)
  92.                 if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetFlash) < 1) GivePlayerItem(client, "weapon_flashbang");
  93.         for(int x = 0; x < 1; x++)
  94.                 if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetSmoke) < 1) GivePlayerItem(client, "weapon_smokegrenade");
  95.         if(GetClientTeam(client) == CS_TEAM_CT)
  96.         {
  97.                 for(int x = 0; x < ; x++)                                                                                       // ilosc inc
  98.                         if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetInc) < ) GivePlayerItem(client, "weapon_incgrenade");
  99.         }
  100.         else if(GetClientTeam(client) == CS_TEAM_T)
  101.         {
  102.                 for(int x = 0; x < ; x++)
  103.                         if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetMol) < ) GivePlayerItem(client, "weapon_molotov");
  104.         }
  105.         for(int x = 0; x < ; x++)
  106.                 if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetDecoy) < ) GivePlayerItem(client, "weapon_decoy");
  107.         for(int x = 0; x < ; x++)
  108.                 if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetTa) < ) GivePlayerItem(client, "weapon_tagrenade");
  109.         for(int x = 0; x < ; x++)
  110.                 if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHealth) < ) GivePlayerItem(client, "weapon_healthshot");
  111. }
  112. public Action PlayerDeath(Handle event, const char[] name, bool dontBroadcast)
  113. {
  114.         int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  115.         if(!IsValidPlayer(attacker) || !IsPlayerVIP(attacker)) return;
  116.         int health = GetClientHealth(attacker);
  117.         SetEntityHealth(attacker, health+5);
  118.         bool headshot = GetEventBool(event, "headshot", false);
  119.         if(headshot)
  120.         {
  121.                 health = GetClientHealth(attacker);
  122.                 SetEntityHealth(attacker, health+10);
  123.         }
  124.         if(GetClientHealth(attacker) > 130)
  125.                                 SetEntityHealth(attacker, 130);
  126. }
  127.  
  128. public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float[3] vel, float[3] angles, int &weapon)
  129.                 {
  130.                         if(!IsValidPlayer(client) || !IsPlayerAlive(client)) return;
  131.                         if(!IsPlayerVIP(client)) return;
  132.         static int g_fLastButtons[MAXPLAYERS+1], g_fLastFlags[MAXPLAYERS+1], g_iJumps[MAXPLAYERS+1], fCurFlags, fCurButtons;
  133.                         fCurFlags = GetEntityFlags(client);
  134.                         fCurButtons = GetClientButtons(client);
  135.                         if (g_fLastFlags[client] & FL_ONGROUND && !(fCurFlags & FL_ONGROUND) && !(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP) g_iJumps[client]++;
  136.                         else if(fCurFlags & FL_ONGROUND) g_iJumps[client] = 0;
  137.                         else if(!(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP && g_iJumps[client] <= 3)
  138.                         {
  139.                                 g_iJumps[client]++;
  140.                                 float vVel[3];
  141.                                 GetEntPropVector(client, Prop_Data, "m_vecVelocity", vVel);
  142.                                 vVel[2] = 250.0;
  143.                                 TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vVel);
  144.                         }
  145.                         g_fLastFlags[client] = fCurFlags;
  146.                         g_fLastButtons[client] = fCurButtons;
  147.                        
  148. }
  149.  
  150. stock bool IsValidPlayer(int client)
  151. {
  152.         if(client >= 1 && client <= MaxClients && IsClientInGame(client) && !IsFakeClient(client) && !IsClientSourceTV(client))
  153.                 return true;
  154.         return false;
  155. }
  156. stock bool IsPlayerVIP(int client)
  157. {
  158.         if(GetUserFlagBits(client) & ADMFLAG_CUSTOM4)
  159.                 return true;
  160.         return false;
  161. }
  162.