Facebook
From mieszi, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 240
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdktools_sound>
  4. #include <cstrike>
  5. #include <clientprefs>
  6. #include <smlib>
  7. #include <sdkhooks>
  8. #include <csgocolors>
  9.  
  10. #pragma semicolon 1
  11.  
  12. new bool:g_Ivisivel[MAXPLAYERS+1] = {false, ...};
  13. new bool:g_Godmode[MAXPLAYERS+1] = {false, ...};
  14. new bool:poison[MAXPLAYERS+1] = {false, ...};
  15. new bool:vampire[MAXPLAYERS+1] = {false, ...};
  16. new bool:super_faca[MAXPLAYERS+1] = {false, ...};
  17. new bool:view[MAXPLAYERS+1] = {false, ...};
  18. new bool:fogo[MAXPLAYERS+1] = {false, ...};
  19. new bool:AWP[MAXPLAYERS+1] = {true,...};
  20. new bool:EAGLE[MAXPLAYERS+1] = {true, ...};
  21. new bool:bhop[MAXPLAYERS+1] = {false, ...};
  22.  
  23. #define VERSION "Private version"
  24.  
  25. new g_iCreditos[MAXPLAYERS+1];
  26.  
  27. new iEnt;
  28. new String:EntityList[][] = {
  29.        
  30.         "func_door",
  31.         "func_rotating",
  32.         "func_walltoggle",
  33.     "func_breakable",
  34.         "func_door_rotating",
  35.         "func_movelinear",
  36.         "prop_door",
  37.         "prop_door_rotating",
  38.         "func_tracktrain",
  39.         "func_elevator",
  40.         "\0"
  41. };
  42.  
  43.  
  44. new Handle:cvarCreditosMax = INVALID_HANDLE;
  45. new Handle:cvarCreditosKill_CT = INVALID_HANDLE;
  46. new Handle:cvarCreditosKill_T = INVALID_HANDLE;
  47. new Handle:cvarCreditos_LR = INVALID_HANDLE;
  48. new Handle:cvarCreditosKill_CT_VIP = INVALID_HANDLE;
  49. new Handle:cvarCreditosKill_T_VIP = INVALID_HANDLE;
  50. new Handle:cvarCreditos_LR_VIP = INVALID_HANDLE;
  51. new Handle:cvarCreditosSave = INVALID_HANDLE;
  52. new Handle:cvarTronly = INVALID_HANDLE;
  53. new Handle:cvarEnableRevive = INVALID_HANDLE;
  54. new Handle:cvarSpawnMsg = INVALID_HANDLE;
  55. new Handle:cvarCreditsOnWarmup = INVALID_HANDLE;
  56. new Handle:cvarMinPlayersToGetCredits = INVALID_HANDLE;
  57. new Handle:cvar_3;
  58. new Handle:cvar_6;
  59. new Handle:cvar_9;
  60. new Handle:cvar_11;
  61. new Handle:cvar_15;
  62. new Handle:cvar_18;
  63.  
  64.  
  65. //new Handle:cvarRoundCreditos = INVALID_HANDLE;
  66. //new Handle:cvarCrInterval = INVALID_HANDLE;
  67.  
  68. new Handle:c_GameCreditos = INVALID_HANDLE;
  69.  
  70. new g_sprite;
  71. new g_HaloSprite;
  72.  
  73.  
  74. public Plugin:myinfo =
  75. {
  76.     name = "Deathrun ErrorHead.pl",
  77.     author = "Edited by Mieszi",
  78.     description = "Comprar itens no shop jailbreak",
  79.     version = VERSION,
  80. };
  81.  
  82. public OnPluginStart()
  83. {
  84.  
  85.         LoadTranslations("common.phrases");
  86.         LoadTranslations("jail_shop.phrases");
  87.         c_GameCreditos = RegClientCookie("Creditos", "Creditos", CookieAccess_Private);
  88.  
  89.         // ======================================================================
  90.  
  91.         HookEvent("player_spawn", PlayerSpawn);
  92.         HookEvent("player_death", PlayerDeath);
  93.         HookEvent("smokegrenade_detonate", Event_SmokeGrenadeDetonate, EventHookMode_Post);
  94.         HookEvent("smokegrenade_detonate", Event_SmokeGrenadeDetonate2, EventHookMode_Post);
  95.         HookEvent("player_hurt",EventPlayerHurt, EventHookMode_Pre);
  96.         HookEvent("round_end", Event_OnRoundEnd);
  97.        
  98.         // ======================================================================
  99.  
  100.         RegConsoleCmd("sm_shop", SHOPMENU);
  101.         RegConsoleCmd("sm_credits", Creditos);
  102.         RegConsoleCmd("sm_gift", Command_SendCredits);
  103.         RegConsoleCmd("sm_reviver", Reviver);
  104.         RegConsoleCmd("sm_vercreditos", Command_ShowCredits);
  105.        
  106.         RegAdminCmd("sm_give", SetCreditos, ADMFLAG_ROOT);
  107.         RegAdminCmd("sm_set", SetCreditos2, ADMFLAG_ROOT);
  108.         // ======================================================================
  109.  
  110.         // ======================================================================
  111.  
  112.         cvarCreditosMax = CreateConVar("shop_creditos_maximo", "100000", "Maxim of credits for player");
  113.         cvarCreditosKill_T = CreateConVar("shop_creditos_por_kill_t", "100", "Amount of credits for kill ( prisioner )");
  114.         cvarCreditosKill_CT = CreateConVar("shop_creditos_por_kill_ct", "100", "Amount of credits for kill ( guard )");
  115.         cvarCreditos_LR = CreateConVar("shop_creditos_por_kill_lr", "200", "Amount of credits for the last player");
  116.         cvarCreditosKill_T_VIP = CreateConVar("shop_creditos_por_kill_t_vip", "250", "Amount of credits for kill ( prisioner ) for VIP (flag a)");
  117.         cvarCreditosKill_CT_VIP = CreateConVar("shop_creditos_por_kill_ct_vip", "250", "Amount of credits for kill ( guard ) for VIP (flag a)");
  118.         cvarCreditos_LR_VIP = CreateConVar("shop_creditos_por_kill_lr_vip", "450", "Amount of credits for the last player for VIP (flag a)");
  119.         cvarSpawnMsg = CreateConVar("shop_spawnmessages", "1", "Messages on spawn", FCVAR_NONE, true, 0.0, true, 1.0);
  120.         cvarCreditosSave = CreateConVar("shop_creditos_save", "1", "Save or not credits on player disconnect", FCVAR_NONE, true, 0.0, true, 1.0);
  121.         cvarTronly = CreateConVar("shop_terrorist_only", "0", "Menu for only prisioners", FCVAR_NONE, true, 0.0, true, 1.0);
  122.         cvarEnableRevive = CreateConVar("shop_ativar_revive", "1", "Enable/Disble revive", FCVAR_NONE, true, 0.0, true, 1.0);
  123.         cvarCreditsOnWarmup = CreateConVar("shop_warmupcredits", "0", "Should players get credits on warmup?");
  124.         cvarMinPlayersToGetCredits = CreateConVar("shop_minplayers", "5", "Minimum players to get credits");
  125.                
  126.        
  127.         cvar_3 = CreateConVar("preco_03", "8000", "Price of item (imortal)");
  128.         cvar_6 = CreateConVar("preco_06", "4500", "Price of item (hp)");
  129.         cvar_8 = CreateConVar("preco_08", "10000", "Price of item (super knife)");
  130.         cvar_9 = CreateConVar("preco_09", "250", "Price of item (healing)");
  131.         cvar_11 = CreateConVar("preco_11", "7000", "Price of item (skin)");
  132.         cvar_15 = CreateConVar("preco_15", "8000", "Price of item (respawn)");
  133.         cvar_18 = CreateConVar("preco_18", "4500", "Price of item (low gravity)");
  134.        
  135.        
  136.         if(GetConVarBool(cvarCreditosSave))
  137.         {
  138.                 for(new client = 1; client <= MaxClients; client++)
  139.                 {
  140.                         if(IsClientInGame(client))
  141.                         {
  142.                                 if(AreClientCookiesCached(client))
  143.                                 {
  144.                                         OnClientCookiesCached(client);
  145.                                 }
  146.                         }
  147.                 }
  148.         }
  149.        
  150.         AutoExecConfig(true, "sm_shopjail");
  151.        
  152. }
  153.  
  154.  
  155. public OnPluginEnd()
  156. {
  157.         if(!GetConVarBool(cvarCreditosSave))
  158.                 return;
  159.  
  160.         for(new client = 1; client <= MaxClients; client++)
  161.         {
  162.                 if(IsClientInGame(client))
  163.                 {
  164.                         OnClientDisconnect(client);
  165.                 }
  166.         }
  167. }
  168.  
  169.  
  170. public OnClientCookiesCached(client)
  171. {
  172.         if(!GetConVarBool(cvarCreditosSave))
  173.                 return;
  174.  
  175.         new String:CreditosString[12];
  176.         GetClientCookie(client, c_GameCreditos, CreditosString, sizeof(CreditosString));
  177.         g_iCreditos[client]  = StringToInt(CreditosString);
  178. }  
  179.  
  180. public OnClientDisconnect(client)
  181. {      
  182.         if(!GetConVarBool(cvarCreditosSave))
  183.         {
  184.                 g_iCreditos[client] = 0;
  185.                 return;
  186.         }
  187.        
  188.         if(AreClientCookiesCached(client))
  189.         {
  190.                 new String:CreditosString[12];
  191.                 Format(CreditosString, sizeof(CreditosString), "%i", g_iCreditos[client]);
  192.                 SetClientCookie(client, c_GameCreditos, CreditosString);
  193.         }
  194.        
  195. }
  196.  
  197.  
  198. public OnMapStart()
  199. {
  200.         g_sprite = PrecacheModel("materials/sprites/laserbeam.vmt", true);
  201.         g_HaloSprite = PrecacheModel("materials/sprites/halo.vmt", true);
  202. }
  203.  
  204.  
  205. public Action:MensajesSpawn(Handle:timer, any:client)
  206. {
  207.         if(GetConVarBool(cvarSpawnMsg) && IsClientInGame(client))
  208.         {
  209.                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Kill");
  210.                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Type");
  211.         }
  212. }
  213.  
  214. public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
  215. {
  216.         new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  217.         new client = GetClientOfUserId(GetEventInt(event, "userid"));
  218.  
  219.         CreateTimer(2.0, MensajesMuerte, client);
  220.        
  221.        
  222.         if (!attacker)
  223.                 return;
  224.  
  225.         if (attacker == client)
  226.                 return;
  227.  
  228.         if(!GetConVarBool(cvarCreditosKill_CT))
  229.                 return;
  230.        
  231.         if(!GetConVarBool(cvarCreditosKill_T))
  232.                 return;
  233.        
  234.         if(GetAllPlayersCount() >= GetConVarInt(cvarMinPlayersToGetCredits) && (GetConVarInt(cvarCreditsOnWarmup) != 0 || GameRules_GetProp("m_bWarmupPeriod") != 1) )
  235.         {
  236.                 if(GetClientTeam(attacker) == CS_TEAM_CT)
  237.                 {
  238.                         if (IsPlayerReservationAdmin(attacker))
  239.                                 g_iCreditos[attacker] += GetConVarInt(cvarCreditosKill_CT_VIP);
  240.                         else
  241.                                 g_iCreditos[attacker] += GetConVarInt(cvarCreditosKill_CT);
  242.                 }
  243.                
  244.                 if(GetClientTeam(attacker) == CS_TEAM_T)
  245.                 {
  246.                         if (IsPlayerReservationAdmin(attacker))
  247.                                 g_iCreditos[attacker] += GetConVarInt(cvarCreditosKill_T_VIP);
  248.                         else
  249.                                 g_iCreditos[attacker] += GetConVarInt(cvarCreditosKill_T);
  250.                 }
  251.         }
  252.         if(GetAllPlayersCount() >= GetConVarInt(cvarMinPlayersToGetCredits) && (GetConVarInt(cvarCreditsOnWarmup) != 0 || GameRules_GetProp("m_bWarmupPeriod") != 1) )
  253.         {
  254.                 if (g_iCreditos[attacker] < GetConVarInt(cvarCreditosMax))
  255.                 {
  256.                         if(GetClientTeam(attacker) == CS_TEAM_CT)
  257.                         {
  258.                                 if (IsPlayerReservationAdmin(attacker))
  259.                                         CPrintToChat(attacker, "\x0E[ SHOP ] \x04%t","KillCT", g_iCreditos[attacker],GetConVarInt(cvarCreditosKill_CT_VIP));
  260.                                 else
  261.                                         CPrintToChat(attacker, "\x0E[ SHOP ] \x04%t","KillCT", g_iCreditos[attacker],GetConVarInt(cvarCreditosKill_CT));
  262.                         }
  263.                
  264.                         if(GetClientTeam(attacker) == CS_TEAM_T)
  265.                         {
  266.                                 if (IsPlayerReservationAdmin(attacker))
  267.                                         CPrintToChat(attacker, "\x0E[ SHOP ] \x04%t","KillT", g_iCreditos[attacker],GetConVarInt(cvarCreditosKill_T_VIP));
  268.                                 else
  269.                                         CPrintToChat(attacker, "\x0E[ SHOP ] \x04%t","KillT", g_iCreditos[attacker],GetConVarInt(cvarCreditosKill_T));
  270.                         }
  271.                        
  272.                        
  273.                 }
  274.                 else
  275.                 {
  276.                         CPrintToChat(attacker, "\x0E[ SHOP ] \x04%t","Maximo", g_iCreditos[attacker]);
  277.                         g_iCreditos[attacker] = GetConVarInt(cvarCreditosMax);
  278.                 }
  279.         }
  280. }
  281.  
  282. public Action:MensajesMuerte(Handle:timer, any:client)
  283. {
  284.  if (IsClientInGame(client))
  285.  {
  286.         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Reviver4",GetConVarInt(cvar_15));
  287.  }
  288. }
  289.  
  290. public Action:Creditos(client, args)
  291. {
  292.         if(client == 0)
  293.         {
  294.                 PrintToServer("%t","Command is in-game only");
  295.                 return;
  296.         }
  297.         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Creditos", g_iCreditos[client]);
  298. }
  299.  
  300. public Action:SHOPMENU(client,args)
  301. {
  302.         if(GetConVarBool(cvarTronly))
  303.         {
  304.                 if(GetClientTeam(client) != 2)
  305.                 {
  306.                          CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Prisioneiros");
  307.                          return;
  308.                 }
  309.                 else
  310.                 {
  311.                         DID(client);
  312.                 }
  313.         }
  314.         else
  315.         {
  316.                 DID(client);
  317.         }
  318. }
  319.  
  320. public Action:Reviver(client,args)
  321. {
  322.         if(client == 0)
  323.         {
  324.                 PrintToServer("%t","Command is in-game only");
  325.                 return;
  326.         }
  327.        
  328.         if(GetConVarBool(cvarEnableRevive))
  329.         {
  330.                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Ativado");
  331.                 return;
  332.         }
  333.        
  334.         if(GetConVarBool(cvarTronly))
  335.         {
  336.                 if(GetClientTeam(client) != 2)
  337.                 {
  338.                          CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Prisioneiros2");
  339.                          return;
  340.                 }
  341.                 else
  342.                 {
  343.                         if (IsClientInGame(client) && !IsPlayerAlive(client))
  344.                         {
  345.                                 if (g_iCreditos[client] >= GetConVarInt(cvar_15))
  346.                                 {
  347.  
  348.                                         CS_RespawnPlayer(client);
  349.  
  350.                                         g_iCreditos[client] -= GetConVarInt(cvar_15);
  351.  
  352.                                         decl String:nome[32];
  353.                                         GetClientName(client, nome, sizeof(nome));
  354.                                        
  355.                                         CPrintToChatAll("\x0E[ SHOP ] \x04The player\x03 %s \x04has respawned!", nome);
  356.  
  357.                                 }
  358.                                 else
  359.                                 {
  360.                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item reviver", g_iCreditos[client],GetConVarInt(cvar_15));
  361.                                 }
  362.                         }
  363.                         else
  364.                         {
  365.                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Morto");
  366.                         }
  367.                 }
  368.         }
  369.         else
  370.         {
  371.                 if (!IsPlayerAlive(client))
  372.                 {
  373.                         if (g_iCreditos[client] >= GetConVarInt(cvar_15))
  374.                         {
  375.  
  376.                                 CS_RespawnPlayer(client);
  377.  
  378.                                 g_iCreditos[client] -= GetConVarInt(cvar_15);
  379.  
  380.                                 decl String:nome[32];
  381.                                 GetClientName(client, nome, sizeof(nome));
  382.                                
  383.                                
  384.                                 CPrintToChatAll("\x0E[ SHOP ] \x04The player\x03 %s \x04has respawned!", nome);
  385.  
  386.                         }
  387.                         else
  388.                         {
  389.                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item reviver", g_iCreditos[client],GetConVarInt(cvar_15));
  390.                         }
  391.                 }
  392.                 else
  393.                 {
  394.                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Morto");
  395.                 }
  396.         }
  397. }
  398.  
  399.  
  400. public Action:EventPlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
  401. // ----------------------------------------------------------------------------
  402. {
  403.         new victim = GetClientOfUserId(GetEventInt(event,"userid"));
  404.         new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  405.         if(attacker == 0 || !fogo[attacker])
  406.                 return;
  407.  
  408.         if(victim != attacker && attacker !=0 && attacker <MAXPLAYERS){
  409.                 new String:sWeaponUsed[50];
  410.                 GetEventString(event,"weapon",sWeaponUsed,sizeof(sWeaponUsed));
  411.                 if(StrEqual(sWeaponUsed,"hegrenade"))
  412.                 {
  413.                         IgniteEntity(victim, 15.0);
  414.                 }
  415.                
  416.         }
  417. }
  418.  
  419. public Action:Event_SmokeGrenadeDetonate2(Handle:event, const String:name[], bool:dontBroadcast)
  420. {
  421.         new client = GetClientOfUserId(GetEventInt(event, "userid"));
  422.         if(view[client] == true)
  423.         {
  424.                 view[client] = false;
  425.                 if(IsClientInGame(client))
  426.                 SetClientViewEntity(client, client);
  427.                 new Float:origin[3];
  428.  
  429.                 // Dest. location
  430.                 origin[0] = float(GetEventInt(event, "x"));
  431.                 origin[1] = float(GetEventInt(event, "y"));
  432.                 origin[2] = float(GetEventInt(event, "z"));
  433.                
  434.                 //TELEPORT TO PLACE WHERE THE GRENADE WILL EXPLODE!
  435.                 TeleportEntity(client, origin, NULL_VECTOR, NULL_VECTOR);
  436.         }
  437. }
  438.  
  439. public Action:Event_SmokeGrenadeDetonate(Handle:event, const String:name[], bool:dontBroadcast)
  440. {
  441.         new Float:DetonateOrigin[3];
  442.         DetonateOrigin[0] = GetEventFloat(event, "x");
  443.         DetonateOrigin[1] = GetEventFloat(event, "y");
  444.         DetonateOrigin[2] = GetEventFloat(event, "z");
  445.  
  446.         new client = GetClientOfUserId(GetEventInt(event, "userid"));
  447.         if(!poison[client])
  448.                 return;
  449.  
  450.         new iEntity = CreateEntityByName("light_dynamic");
  451.  
  452.         if (iEntity == -1)
  453.         {
  454.                 return;
  455.         }
  456.         DispatchKeyValue(iEntity, "inner_cone", "0");
  457.         DispatchKeyValue(iEntity, "cone", "80");
  458.         DispatchKeyValue(iEntity, "brightness", "5");
  459.         DispatchKeyValueFloat(iEntity, "spotlight_radius", 96.0);
  460.         DispatchKeyValue(iEntity, "pitch", "90");
  461.         DispatchKeyValue(iEntity, "style", "6");
  462.         DispatchKeyValue(iEntity, "_light", "0 255 0");
  463.         DispatchKeyValueFloat(iEntity, "distance", 256.0);
  464.         SetEntPropEnt(iEntity, Prop_Send, "m_hOwnerEntity", client);
  465.         CreateTimer(20.0, Delete, iEntity, TIMER_FLAG_NO_MAPCHANGE);
  466.  
  467.         TE_SetupBeamRingPoint(DetonateOrigin, 99.0, 100.0, g_sprite, g_HaloSprite, 0, 15, 20.0, 10.0, 220.0, {50, 255, 50, 255}, 10, 0);
  468.         TE_SendToAll();
  469.  
  470.         TE_SetupBeamRingPoint(DetonateOrigin, 99.0, 100.0, g_sprite, g_HaloSprite, 0, 15, 20.0, 10.0, 220.0, {50, 50, 255, 255}, 10, 0);
  471.         TE_SendToAll();
  472.  
  473.         DispatchSpawn(iEntity);
  474.         TeleportEntity(iEntity, DetonateOrigin, NULL_VECTOR, NULL_VECTOR);
  475.         AcceptEntityInput(iEntity, "TurnOn");
  476.  
  477.         CreateTimer(1.0, Timer_CheckDamage, iEntity, TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
  478.                
  479.         poison[client] = false;
  480. }
  481.  
  482. public OnEntityCreated(iEntity, const String:classname[])
  483. {
  484.         if(StrEqual(classname, "smokegrenade_projectile"))
  485.                 SDKHook(iEntity, SDKHook_SpawnPost, OnEntitySpawned);
  486. }
  487.  
  488. public OnEntitySpawned(iGrenade)
  489. {
  490.         new client = GetEntPropEnt(iGrenade, Prop_Send, "m_hOwnerEntity");
  491.         if(view[client] && IsClientInGame(client))
  492.         {
  493.                 SetClientViewEntity(client, iGrenade);
  494.         }
  495. }
  496.  
  497. public Action:Delete(Handle:timer, any:entity)
  498. {
  499.         if(IsValidEdict(entity))
  500.                 AcceptEntityInput(entity, "kill");
  501. }
  502.  
  503. public Action:Delete2(Handle:timer, any:entity)
  504. {
  505.         if(IsValidEdict(entity))
  506.                 AcceptEntityInput(entity, "kill");
  507. }
  508.  
  509. public Action:Timer_CheckDamage(Handle:timer, any:iEntity)
  510. {
  511.  
  512.         if(!IsValidEdict(iEntity))
  513.                 return Plugin_Stop;
  514.  
  515.         new client = GetEntPropEnt(iEntity, Prop_Send, "m_hOwnerEntity");
  516.  
  517.  
  518.         if (!IsClientInGame(client) || !IsPlayerAlive(client))
  519.                 return Plugin_Stop;
  520.  
  521.  
  522.         new Float:fSmokeOrigin[3], Float:fOrigin[3];
  523.         GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fSmokeOrigin);
  524.  
  525.         for(new i=1;i<=MaxClients;i++)
  526.         {
  527.                 if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) != GetClientTeam(client))
  528.                 {
  529.                         GetClientAbsOrigin(i, fOrigin);
  530.                         if(GetVectorDistance(fSmokeOrigin, fOrigin) <= 220)
  531.                                 //SDKHooks_TakeDamage(i, iGrenade, client, GetConVarFloat(g_hCVDamage), DMG_POISON, -1, NULL_VECTOR, fSmokeOrigin);
  532.                                 DealDamage(i,75,client,DMG_POISON,"weapon_smokegrenade");
  533.                 }
  534.         }
  535.         return Plugin_Continue;
  536. }
  537.  
  538. stock DealDamage(nClientVictim, nDamage, nClientAttacker = 0, nDamageType = DMG_GENERIC, String:sWeapon[] = "")
  539. // ----------------------------------------------------------------------------
  540. {
  541.         // taken from: http://forums.alliedmods.net/showthread.php?t=111684
  542.         // thanks to the authors!
  543.         if(     nClientVictim > 0 &&
  544.                         IsValidEdict(nClientVictim) &&
  545.                         IsClientInGame(nClientVictim) &&
  546.                         IsPlayerAlive(nClientVictim) &&
  547.                         nDamage > 0)
  548.         {
  549.                 new EntityPointHurt = CreateEntityByName("point_hurt");
  550.                 if(EntityPointHurt != 0)
  551.                 {
  552.                         new String:sDamage[16];
  553.                         IntToString(nDamage, sDamage, sizeof(sDamage));
  554.  
  555.                         new String:sDamageType[32];
  556.                         IntToString(nDamageType, sDamageType, sizeof(sDamageType));
  557.  
  558.                         DispatchKeyValue(nClientVictim,                 "targetname",           "war3_hurtme");
  559.                         DispatchKeyValue(EntityPointHurt,               "DamageTarget", "war3_hurtme");
  560.                         DispatchKeyValue(EntityPointHurt,               "Damage",                               sDamage);
  561.                         DispatchKeyValue(EntityPointHurt,               "DamageType",           sDamageType);
  562.                         if(!StrEqual(sWeapon, ""))
  563.                                 DispatchKeyValue(EntityPointHurt,       "classname",            sWeapon);
  564.                         DispatchSpawn(EntityPointHurt);
  565.                         AcceptEntityInput(EntityPointHurt,      "Hurt",                                 (nClientAttacker != 0) ? nClientAttacker : -1);
  566.                         DispatchKeyValue(EntityPointHurt,               "classname",            "point_hurt");
  567.                         DispatchKeyValue(nClientVictim,                 "targetname",           "war3_donthurtme");
  568.  
  569.                         RemoveEdict(EntityPointHurt);
  570.                 }
  571.         }
  572. }
  573.  
  574.  
  575. public Action:DID(clientId)
  576. {
  577.         new Handle:menu = CreateMenu(DIDMenuHandler);
  578.         SetMenuTitle(menu, "%t","Shop", g_iCreditos[clientId]);
  579.         decl String:opcionmenu[124];
  580.        
  581.         Format(opcionmenu, 124, "%T","Invisivel", clientId,GetConVarInt(cvar_1));
  582.         AddMenuItem(menu, "option5", opcionmenu);      
  583.        
  584.         Format(opcionmenu, 124, "%T","AWP", clientId,GetConVarInt(cvar_2));
  585.         AddMenuItem(menu, "option6", opcionmenu);
  586.                
  587.         Format(opcionmenu, 124, "%T","Imortal", clientId,GetConVarInt(cvar_3));
  588.         AddMenuItem(menu, "option8", opcionmenu);
  589.                
  590.         Format(opcionmenu, 124, "%T","Jail", clientId,GetConVarInt(cvar_4));
  591.         AddMenuItem(menu, "option9", opcionmenu);
  592.                
  593.         Format(opcionmenu, 124, "%T","Rapido", clientId,GetConVarInt(cvar_5));
  594.         AddMenuItem(menu, "option10", opcionmenu);
  595.                
  596.         Format(opcionmenu, 124, "%T","HP", clientId,GetConVarInt(cvar_6));
  597.         AddMenuItem(menu, "option12", opcionmenu);
  598.                
  599.         Format(opcionmenu, 124, "%T","Eagle", clientId,GetConVarInt(cvar_7));
  600.         AddMenuItem(menu, "option13", opcionmenu);
  601.                
  602.         Format(opcionmenu, 124, "%T","Super", clientId,GetConVarInt(cvar_8));
  603.         AddMenuItem(menu, "option14", opcionmenu);
  604.                
  605.         Format(opcionmenu, 124, "%T","Cura", clientId,GetConVarInt(cvar_9));
  606.         AddMenuItem(menu, "option15", opcionmenu);
  607.                
  608.         decl String:sGame[64];
  609.         GetGameFolderName(sGame, sizeof(sGame));
  610.         if (StrEqual(sGame, "cstrike"))
  611.         {
  612.                 Format(opcionmenu, 124, "%T","2flash", clientId,GetConVarInt(cvar_10));
  613.                 AddMenuItem(menu, "option16", opcionmenu);
  614.         }
  615.         else if (StrEqual(sGame, "csgo"))
  616.         {
  617.                 Format(opcionmenu, 124, "%T","Molotov", clientId,GetConVarInt(cvar_10));
  618.                 AddMenuItem(menu, "option16", opcionmenu);
  619.         }
  620.        
  621.         Format(opcionmenu, 124, "%T","Skin", clientId,GetConVarInt(cvar_11));
  622.         AddMenuItem(menu, "option17", opcionmenu);
  623.                
  624.         Format(opcionmenu, 124, "%T","Smoke", clientId,GetConVarInt(cvar_12));
  625.         AddMenuItem(menu, "option18", opcionmenu);
  626.        
  627.         Format(opcionmenu, 124, "%T","Teletransportadora3", clientId,GetConVarInt(cvar_14));
  628.         AddMenuItem(menu, "option20", opcionmenu);
  629.        
  630.         Format(opcionmenu, 124, "%T","HE", clientId,GetConVarInt(cvar_16));
  631.         AddMenuItem(menu, "option21", opcionmenu);
  632.        
  633.         Format(opcionmenu, 124, "%T","Bhop", clientId,GetConVarInt(cvar_17));
  634.         AddMenuItem(menu, "option22", opcionmenu);
  635.        
  636.         Format(opcionmenu, 124, "%T","Gravity", clientId,GetConVarInt(cvar_18));
  637.         AddMenuItem(menu, "option23", opcionmenu);
  638.        
  639.         SetMenuExitButton(menu, true);
  640.         DisplayMenu(menu, clientId, MENU_TIME_FOREVER);
  641.  
  642.         return Plugin_Handled;
  643. }
  644.  
  645.  
  646. public DIDMenuHandler(Handle:menu, MenuAction:action, client, itemNum)
  647. {
  648.         if ( action == MenuAction_Select )
  649.         {
  650.                 new String:info[32];
  651.  
  652.                 GetMenuItem(menu, itemNum, info, sizeof(info));
  653.  
  654.                 if ( strcmp(info,"option1") == 0 )
  655.                 {
  656.                         {
  657.                                 DID(client);
  658.                                 CPrintToChat(client,"\x0E[ SHOP ] \x04make by dk.");
  659.                         }
  660.                 }
  661.  
  662.  
  663.  
  664.                         else if ( strcmp(info,"option5") == 0 )
  665.                         {
  666.                                 {
  667.                                         DID(client);
  668.                                        
  669.                                                        
  670.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_1))
  671.                                         {
  672.                                                 if (IsPlayerAlive(client))
  673.                                                 {
  674.                                                         decl String:sGame[255];
  675.                                                         GetGameFolderName(sGame, sizeof(sGame));
  676.                                                         if (StrEqual(sGame, "cstrike") || StrEqual(sGame, "cstrike_beta"))
  677.                                                         {
  678.                                                                 SetEntityRenderMode(client, RENDER_TRANSCOLOR);
  679.                                                                 SetEntityRenderColor(client, 255, 255, 255, 0);
  680.                                                                 g_Ivisivel[client] = true;             
  681.                                                                 CreateTimer(10.0, Invisible2, client);
  682.                                                         }
  683.                                                         else if (StrEqual(sGame, "csgo"))
  684.                                                         {
  685.                                                                 SDKHook(client, SDKHook_SetTransmit, Hook_SetTransmit);
  686.                                                                 g_Ivisivel[client] = true;             
  687.                                                                 CreateTimer(10.0, Invisible, client);
  688.                                                         }
  689.  
  690.                                                         new wepIdx;
  691.  
  692.                                                         // strip all weapons
  693.                                                         for (new s = 0; s < 4; s++)
  694.                                                         {
  695.                                                                 if ((wepIdx = GetPlayerWeaponSlot(client, s)) != -1)
  696.                                                                 {
  697.                                                                         RemovePlayerItem(client, wepIdx);
  698.                                                                         RemoveEdict(wepIdx);
  699.                                                                 }
  700.                                                         }
  701.  
  702.                                                         GivePlayerItem(client, "weapon_knife");
  703.                                                        
  704.  
  705.                                                         g_iCreditos[client] -= GetConVarInt(cvar_1);
  706.                                                        
  707.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Invisivel2", g_iCreditos[client],GetConVarInt(cvar_2));
  708.                                                 }
  709.                                                 else
  710.                                                 {
  711.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  712.                                                 }
  713.                                         }
  714.                                         else
  715.                                         {
  716.                                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item invisivel", g_iCreditos[client],GetConVarInt(cvar_1));
  717.                                         }
  718.                                 }
  719.                        
  720.                         }
  721.  
  722.                         else if ( strcmp(info,"option6") == 0 )
  723.                         {
  724.                                 {
  725.                                         DID(client);
  726.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_2))
  727.                                         {
  728.                                                 if(!AWP[client])
  729.                                                 {      
  730.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","MaximoAWP");
  731.                                                 }
  732.                                                 else if(AWP[client] && IsPlayerAlive(client))
  733.                                                 {      
  734.                                                         GivePlayerItem(client, "weapon_awp");
  735.                                                         AWP[client] = false;
  736.                                                         Client_GiveWeaponAndAmmo(client, "weapon_awp", _, 0, _, 1);
  737.                                                         g_iCreditos[client] -= GetConVarInt(cvar_2);
  738.                                                        
  739.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","AWP2", g_iCreditos[client],GetConVarInt(cvar_2));
  740.                                                 }
  741.                                                 else
  742.                                                 {
  743.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  744.                                                 }
  745.                                         }
  746.                                         else
  747.                                         {
  748.                                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item awp", g_iCreditos[client],GetConVarInt(cvar_2));
  749.                                         }
  750.                                 }
  751.                         }
  752.                        
  753.  
  754.                         else if ( strcmp(info,"option8") == 0 )
  755.                         {
  756.                                 {
  757.                                         DID(client);
  758.                                        
  759.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_3))
  760.                                         {
  761.                                                 if (IsPlayerAlive(client))
  762.                                                 {
  763.  
  764.                                                         g_Godmode[client] = true;
  765.                                                         CreateTimer(20.0, OpcionNumero16b, client);
  766.  
  767.                                                         g_iCreditos[client] -= GetConVarInt(cvar_3);
  768.                                                        
  769.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Imortal2", g_iCreditos[client],GetConVarInt(cvar_3));
  770.                                                 }
  771.                                                 else
  772.                                                 {
  773.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  774.                                                 }
  775.                                         }
  776.                                         else
  777.                                         {
  778.                                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item imortal", g_iCreditos[client],GetConVarInt(cvar_3));
  779.                                         }
  780.                                 }
  781.  
  782.                         }
  783.  
  784.                         else if ( strcmp(info,"option9") == 0 )
  785.                         {
  786.                                 {
  787.                                         DID(client);
  788.                                        
  789.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_4))
  790.                                         {
  791.                                                 if (IsPlayerAlive(client))
  792.                                                 {
  793.  
  794.                                                         abrir();
  795.  
  796.                                                         g_iCreditos[client] -= GetConVarInt(cvar_4);
  797.                                                        
  798.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Jails2", g_iCreditos[client],GetConVarInt(cvar_4));
  799.                                                         decl String:nome[32];
  800.                                                         GetClientName(client, nome, sizeof(nome));
  801.  
  802.                                                         CPrintToChatAll("\x0E[ SHOP ] \x04O jogador\x03 %s \x04abriu as jails pelo shop!", nome);
  803.                                                 }
  804.                                                 else
  805.                                                 {
  806.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  807.                                                 }
  808.                                         }
  809.                                         else
  810.                                         {
  811.                                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item jails", g_iCreditos[client],GetConVarInt(cvar_4));
  812.                                         }
  813.                                 }
  814.  
  815.                         }
  816.  
  817.                         else if ( strcmp(info,"option10") == 0 )
  818.                         {
  819.                                 {
  820.                                         DID(client);
  821.                                        
  822.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_5))
  823.                                         {
  824.                                                 if (IsPlayerAlive(client))
  825.                                                 {
  826.  
  827.                                                         SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.5);
  828.  
  829.                                                         g_iCreditos[client] -= GetConVarInt(cvar_5);
  830.                                                         vampire[client] = true;
  831.                                                        
  832.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Rapido2", g_iCreditos[client],GetConVarInt(cvar_5));
  833.                                                 }
  834.                                                 else
  835.                                                 {
  836.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  837.                                                 }
  838.                                         }
  839.                                         else
  840.                                         {
  841.                                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item rapido", g_iCreditos[client],GetConVarInt(cvar_5));
  842.                                         }
  843.                                 }
  844.  
  845.                         }
  846.  
  847.  
  848.                         else if ( strcmp(info,"option12") == 0 )
  849.                         {
  850.                                 {
  851.                                         DID(client);
  852.                                        
  853.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_6))
  854.                                         {
  855.                                                 if (IsPlayerAlive(client))
  856.                                                 {
  857.                                                        
  858.                                                         g_iCreditos[client] -= GetConVarInt(cvar_6);
  859.                                                        
  860.                                                         new vida = (GetClientHealth(client) + 150);
  861.  
  862.                                                         SetEntityHealth(client, vida);
  863.                                                         GivePlayerItem( client, "item_assaultsuit"); // Give Kevlar Suit and a Helmet
  864.                                                         SetEntProp( client, Prop_Send, "m_ArmorValue", 100, 1 ); // Set kevlar armour
  865.                                                        
  866.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","HP2", g_iCreditos[client],GetConVarInt(cvar_6));
  867.                                                 }
  868.                                                         else
  869.                                                         {
  870.                                                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  871.                                                         }
  872.                                         }
  873.                                                         else
  874.                                                         {
  875.                                                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item da vida", g_iCreditos[client],GetConVarInt(cvar_6));
  876.                                                         }
  877.                                 }
  878.  
  879.                         }
  880.  
  881.  
  882.                         else if ( strcmp(info,"option13") == 0 )
  883.                         {
  884.                                 {
  885.                                         DID(client);
  886.                                        
  887.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_7))
  888.                                         {
  889.                                                 if(!EAGLE[client])
  890.                                                 {      
  891.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","MaximoEAGLE");
  892.                                                 }
  893.                                                
  894.                                                 else if(EAGLE[client] && IsPlayerAlive(client))
  895.                                                 {
  896.                                                         GivePlayerItem(client, "weapon_deagle");
  897.                                                         EAGLE[client] = false;
  898.                                                         Client_GiveWeaponAndAmmo(client, "weapon_deagle", _, 0, _, 7);
  899.                                                        
  900.                                                         g_iCreditos[client] -= GetConVarInt(cvar_7);
  901.                                                        
  902.  
  903.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Eagle2", g_iCreditos[client],GetConVarInt(cvar_7));
  904.                                                 }
  905.                                                 else
  906.                                                 {
  907.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  908.                                                 }
  909.  
  910.                                         }
  911.                                                 else
  912.                                                 {
  913.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item da eagle", g_iCreditos[client],GetConVarInt(cvar_7));
  914.                                                 }
  915.                                 }
  916.                         }
  917.  
  918.                         else if ( strcmp(info,"option14") == 0 )
  919.                         {
  920.                                 {
  921.                                         DID(client);
  922.                                        
  923.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_8))
  924.                                         {
  925.                                                 if (IsPlayerAlive(client))
  926.                                                 {
  927.                                                         decl String:sGame[255];
  928.                                                         GetGameFolderName(sGame, sizeof(sGame));
  929.                                                         if (StrEqual(sGame, "cstrike") || StrEqual(sGame, "cstrike_beta"))
  930.                                                         {
  931.                                                                 new currentknife = GetPlayerWeaponSlot(client, 2);
  932.                                                                 if(IsValidEntity(currentknife) && currentknife != INVALID_ENT_REFERENCE)
  933.                                                                 {
  934.                                                                         RemovePlayerItem(client, currentknife);
  935.                                                                         RemoveEdict(currentknife);
  936.                                                                 }
  937.                                                                
  938.                                                                 new knife = GivePlayerItem(client, "weapon_knife");    
  939.                                                                 EquipPlayerWeapon(client, knife);
  940.                                                                
  941.                                                                 super_faca[client] = true;
  942.                                                         }
  943.                                                        
  944.                                                         else if (StrEqual(sGame, "csgo"))
  945.                                                         {
  946.                                                                 new currentknife = GetPlayerWeaponSlot(client, 2);
  947.                                                                 if(IsValidEntity(currentknife) && currentknife != INVALID_ENT_REFERENCE)
  948.                                                                 {
  949.                                                                         RemovePlayerItem(client, currentknife);
  950.                                                                         RemoveEdict(currentknife);
  951.                                                                 }
  952.                                                                
  953.                                                                 new knife = GivePlayerItem(client, "weapon_knifegg");  
  954.                                                                 EquipPlayerWeapon(client, knife);
  955.                                                                
  956.                                                                 super_faca[client] = true;
  957.                                                         }
  958.                                                        
  959.                                                
  960.                                                         g_iCreditos[client] -= GetConVarInt(cvar_8);
  961.                                                        
  962.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Super2", g_iCreditos[client],GetConVarInt(cvar_8));
  963.                                                 }
  964.                                                 else
  965.                                                 {
  966.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  967.                                                 }
  968.  
  969.                                         }
  970.                                                 else
  971.                                                 {
  972.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item da super faca", g_iCreditos[client],GetConVarInt(cvar_8));
  973.                                                 }
  974.                                 }
  975.  
  976.                         }
  977.  
  978.                         else if ( strcmp(info,"option15") == 0 )
  979.                         {
  980.                                 {
  981.                                         DID(client);
  982.                                        
  983.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_9))
  984.                                         {
  985.                                                 if (IsPlayerAlive(client))
  986.                                                 {
  987.                                                         new health = GetEntProp(client, Prop_Send, "m_iHealth");  
  988.                                                        
  989.                                                         if(health >= 100)
  990.                                                         {
  991.                                                                 CPrintToChat(client, "\x0E[ SHOP ] \x04 Your life already is full '-'");
  992.                                                         }
  993.                                                         else
  994.                                                         {
  995.                                                                 SetEntityHealth(client, 100);
  996.                                                                 g_iCreditos[client] -= GetConVarInt(cvar_9);
  997.                                                                
  998.                                                                 EmitSoundToAll("medicsound/medic.wav");
  999.                                                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Curar2", g_iCreditos[client],GetConVarInt(cvar_9));
  1000.                                                         }
  1001.  
  1002.  
  1003.                                                 }
  1004.                                                 else
  1005.                                                 {
  1006.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  1007.                                                 }
  1008.  
  1009.                                         }
  1010.                                                 else
  1011.                                                 {
  1012.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item de curar", g_iCreditos[client],GetConVarInt(cvar_9));
  1013.                                                 }
  1014.                                 }
  1015.  
  1016.                         }
  1017.  
  1018.                         else if ( strcmp(info,"option16") == 0 )
  1019.                         {
  1020.                                 {
  1021.                                         DID(client);
  1022.                                        
  1023.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_10))
  1024.                                         {
  1025.                                                 if (IsPlayerAlive(client))
  1026.                                                 {
  1027.  
  1028.                                                         GivePlayerItem(client, "weapon_molotov");
  1029.                                                         GivePlayerItem(client, "weapon_flashbang");
  1030.                                                         GivePlayerItem(client, "weapon_flashbang");
  1031.  
  1032.                                                         g_iCreditos[client] -= GetConVarInt(cvar_10);
  1033.                                                        
  1034.  
  1035.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Molotov2", g_iCreditos[client],GetConVarInt(cvar_10));
  1036.                                                 }
  1037.                                                 else
  1038.                                                 {
  1039.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  1040.                                                 }
  1041.  
  1042.                                         }
  1043.                                                 else
  1044.                                                 {
  1045.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item da molotov", g_iCreditos[client],GetConVarInt(cvar_10));
  1046.                                                 }
  1047.                                 }
  1048.                         }
  1049.                                
  1050.                        
  1051.                        
  1052.                         else if ( strcmp(info,"option17") == 0 )
  1053.                         {
  1054.                                 {
  1055.                                         DID(client);
  1056.                                        
  1057.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_11))
  1058.                                         {
  1059.                                                 if (IsPlayerAlive(client))
  1060.                                                 {
  1061.                                                         g_iCreditos[client] -= GetConVarInt(cvar_11);
  1062.                                                         SetEntityModel(client, "models/player/ctm_gign_variantc.mdl");
  1063.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Skin2", g_iCreditos[client],GetConVarInt(cvar_11));
  1064.                                                 }
  1065.                                                 else
  1066.                                                 {
  1067.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  1068.                                                 }
  1069.                                                        
  1070.  
  1071.                                         }
  1072.                                                 else
  1073.                                                 {
  1074.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item da skin", g_iCreditos[client],GetConVarInt(cvar_11));
  1075.                                                 }
  1076.                                 }
  1077.  
  1078.                         }
  1079.                        
  1080.                         else if ( strcmp(info,"option18") == 0 )
  1081.                         {
  1082.                                 {
  1083.                                         DID(client);
  1084.                                        
  1085.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_12))
  1086.                                         {
  1087.                                                 if (IsPlayerAlive(client))
  1088.                                                 {
  1089.  
  1090.                                                         GivePlayerItem(client, "weapon_smokegrenade");
  1091.                                                        
  1092.                                                        
  1093.                                                         g_iCreditos[client] -= GetConVarInt(cvar_12);
  1094.                                                        
  1095.                                                        
  1096.                                                         poison[client] = true;
  1097.                                                        
  1098.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Smoke2", g_iCreditos[client],GetConVarInt(cvar_12));
  1099.                                                 }
  1100.                                                 else
  1101.                                                 {
  1102.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  1103.                                                 }
  1104.  
  1105.                                         }
  1106.                                                 else
  1107.                                                 {
  1108.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item da smoke", g_iCreditos[client],GetConVarInt(cvar_12));
  1109.                                                 }
  1110.                                 }
  1111.  
  1112.                         }
  1113.                        
  1114.                        
  1115.                                                
  1116.                         else if ( strcmp(info,"option20") == 0 )
  1117.                         {
  1118.                                 {
  1119.                                         DID(client);
  1120.                                        
  1121.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_14))
  1122.                                         {
  1123.                                                 if (IsPlayerAlive(client))
  1124.                                                 {
  1125.  
  1126.                                                         GivePlayerItem(client, "weapon_smokegrenade");
  1127.                                                        
  1128.                                                        
  1129.                                                         g_iCreditos[client] -= GetConVarInt(cvar_14);
  1130.                                                        
  1131.                                                        
  1132.                                                         view[client] = true;
  1133.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Teletransportadora", g_iCreditos[client],GetConVarInt(cvar_14));
  1134.                                                 }
  1135.                                                 else
  1136.                                                 {
  1137.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  1138.                                                 }
  1139.  
  1140.                                         }
  1141.                                                 else
  1142.                                                 {
  1143.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item da teletransportadora", g_iCreditos[client],GetConVarInt(cvar_14));
  1144.                                                 }
  1145.                                 }
  1146.  
  1147.                         }
  1148.                        
  1149.                         else if ( strcmp(info,"option21") == 0 )
  1150.                         {
  1151.                                 {
  1152.                                         DID(client);
  1153.                                        
  1154.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_16))
  1155.                                         {
  1156.                                                 if (IsPlayerAlive(client))
  1157.                                                 {
  1158.  
  1159.                                                         GivePlayerItem(client, "weapon_hegrenade");
  1160.                                                        
  1161.                                                        
  1162.                                                         g_iCreditos[client] -= GetConVarInt(cvar_16);
  1163.                                                        
  1164.                                                        
  1165.                                                         fogo[client] = true;
  1166.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","HE2", g_iCreditos[client],GetConVarInt(cvar_16));
  1167.                                                 }
  1168.                                                 else
  1169.                                                 {
  1170.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  1171.                                                 }
  1172.  
  1173.                                         }
  1174.                                                 else
  1175.                                                 {
  1176.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item da he2", g_iCreditos[client],GetConVarInt(cvar_16));
  1177.                                                 }
  1178.                                 }
  1179.                                
  1180.                         }
  1181.                        
  1182.                         else if ( strcmp(info,"option22") == 0 )
  1183.                         {
  1184.                                 {
  1185.                                         DID(client);
  1186.                                        
  1187.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_17))
  1188.                                         {
  1189.                                                 if (IsPlayerAlive(client))
  1190.                                                 {
  1191.  
  1192.                                                         g_iCreditos[client] -= GetConVarInt(cvar_17);
  1193.                                                        
  1194.                                                        
  1195.                                                         bhop[client] = true;
  1196.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Bhop2", g_iCreditos[client],GetConVarInt(cvar_17));
  1197.                                                 }
  1198.                                                 else
  1199.                                                 {
  1200.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  1201.                                                 }
  1202.  
  1203.                                         }
  1204.                                                 else
  1205.                                                 {
  1206.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item do bhop", g_iCreditos[client],GetConVarInt(cvar_17));
  1207.                                                 }
  1208.                                 }
  1209.                                
  1210.                         }
  1211.                        
  1212.                         else if ( strcmp(info,"option23") == 0 )
  1213.                         {
  1214.                                 {
  1215.                                         DID(client);
  1216.                                        
  1217.                                         if (g_iCreditos[client] >= GetConVarInt(cvar_18))
  1218.                                         {
  1219.                                                 if (IsPlayerAlive(client))
  1220.                                                 {
  1221.  
  1222.                                                         g_iCreditos[client] -= GetConVarInt(cvar_18);
  1223.                                                        
  1224.                                                        
  1225.                                                         SetEntityGravity(client, 0.6);
  1226.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Gravity2", g_iCreditos[client],GetConVarInt(cvar_18));
  1227.                                                 }
  1228.                                                 else
  1229.                                                 {
  1230.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Vivo");
  1231.                                                 }
  1232.  
  1233.                                         }
  1234.                                                 else
  1235.                                                 {
  1236.                                                         CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Item da gravidade", g_iCreditos[client],GetConVarInt(cvar_18));
  1237.                                                 }
  1238.                                 }
  1239.                                
  1240.                         }
  1241.         }
  1242. }
  1243.  
  1244.  
  1245. public Action:SetCreditos2(client, args)
  1246. {
  1247.     if(client == 0)
  1248.     {
  1249.                 PrintToServer("%t","Command is in-game only");
  1250.                 return Plugin_Handled;
  1251.     }
  1252.  
  1253.     if(args < 2)
  1254.     {
  1255.         ReplyToCommand(client, "[SM] Use: sm_set <#userid|name> [amount]");
  1256.         return Plugin_Handled;
  1257.     }
  1258.  
  1259.     decl String:arg2[10];
  1260.    
  1261.     GetCmdArg(2, arg2, sizeof(arg2));
  1262.  
  1263.     new amount = StringToInt(arg2);
  1264.  
  1265.     decl String:strTarget[32]; GetCmdArg(1, strTarget, sizeof(strTarget));
  1266.  
  1267.    
  1268.     decl String:strTargetName[MAX_TARGET_LENGTH];
  1269.     decl TargetList[MAXPLAYERS], TargetCount;
  1270.     decl bool:TargetTranslate;
  1271.  
  1272.     if ((TargetCount = ProcessTargetString(strTarget, client, TargetList, MAXPLAYERS, COMMAND_FILTER_CONNECTED,
  1273.                                            strTargetName, sizeof(strTargetName), TargetTranslate)) <= 0)
  1274.     {
  1275.           ReplyToTargetError(client, TargetCount);
  1276.           return Plugin_Handled;
  1277.     }
  1278.  
  1279.    
  1280.     for (new i = 0; i < TargetCount; i++)
  1281.     {
  1282.         new iClient = TargetList[i];
  1283.         if (IsClientInGame(iClient))
  1284.         {
  1285.               g_iCreditos[iClient] = amount;
  1286.  
  1287.                          
  1288.               CPrintToChat(iClient, "[ SHOP ] Set \x03%i \x01credits in the player: %N", amount, iClient);
  1289.         }
  1290.     }
  1291.  
  1292.     return Plugin_Continue;
  1293. }
  1294.  
  1295. public Action:SetCreditos(client, args)
  1296. {
  1297.         if(client == 0)
  1298.         {
  1299.                 PrintToServer("%t","Command is in-game only");
  1300.                 return Plugin_Handled;
  1301.         }
  1302.  
  1303.         if(args < 2)
  1304.         {
  1305.                 ReplyToCommand(client, "[SM] Use: sm_give <#userid|name> [amount]");
  1306.                 return Plugin_Handled;
  1307.         }
  1308.  
  1309.         decl String:arg2[10];
  1310.  
  1311.         GetCmdArg(2, arg2, sizeof(arg2));
  1312.  
  1313.         new amount = StringToInt(arg2);
  1314.  
  1315.         decl String:strTarget[32]; GetCmdArg(1, strTarget, sizeof(strTarget));
  1316.  
  1317.  
  1318.         decl String:strTargetName[MAX_TARGET_LENGTH];
  1319.         decl TargetList[MAXPLAYERS], TargetCount;
  1320.         decl bool:TargetTranslate;
  1321.  
  1322.         if ((TargetCount = ProcessTargetString(strTarget, client, TargetList, MAXPLAYERS, COMMAND_FILTER_CONNECTED,
  1323.                                                                                    strTargetName, sizeof(strTargetName), TargetTranslate)) <= 0)
  1324.         {
  1325.                   ReplyToTargetError(client, TargetCount);
  1326.                   return Plugin_Handled;
  1327.         }
  1328.  
  1329.  
  1330.         for (new i = 0; i < TargetCount; i++)
  1331.         {
  1332.                 new iClient = TargetList[i];
  1333.                 if (IsClientInGame(iClient))
  1334.                 {
  1335.                           g_iCreditos[iClient] += amount;
  1336.                          
  1337.                           CPrintToChat(iClient, "[ SHOP ] Give \x03%i \x01credits in the player: %N", amount, iClient);
  1338.  
  1339.                 }
  1340.         }
  1341.  
  1342.         return Plugin_Continue;
  1343. }
  1344.  
  1345. public Action:Command_SendCredits(client, args)
  1346. {
  1347.         if(client == 0)
  1348.         {
  1349.                 PrintToServer("%t","Command is in-game only");
  1350.                 return Plugin_Handled;
  1351.         }
  1352.  
  1353.         if(args < 2) // Not enough parameters
  1354.         {
  1355.                 ReplyToCommand(client, "[SM] Use: sm_gift <#userid|name> [amount]");
  1356.                 return Plugin_Handled;
  1357.         }
  1358.  
  1359.         decl String:arg2[10];
  1360.         GetCmdArg(2, arg2, sizeof(arg2));
  1361.  
  1362.         new amount = StringToInt(arg2);
  1363.  
  1364.         decl String:strTarget[32]; GetCmdArg(1, strTarget, sizeof(strTarget));
  1365.  
  1366.         decl String:strTargetName[MAX_TARGET_LENGTH];
  1367.         decl TargetList[MAXPLAYERS], TargetCount;
  1368.         decl bool:TargetTranslate;
  1369.  
  1370.         if ((TargetCount = ProcessTargetString(strTarget, client, TargetList, MAXPLAYERS, COMMAND_FILTER_CONNECTED,
  1371.                 strTargetName, sizeof(strTargetName), TargetTranslate)) <= 0)
  1372.         {
  1373.                 ReplyToTargetError(client, TargetCount);
  1374.                 return Plugin_Handled;
  1375.         }
  1376.        
  1377.         for (new i = 0; i < TargetCount; i++)
  1378.         {
  1379.                 new iClient = TargetList[i];
  1380.                 if (IsClientInGame(iClient) && amount > 0)
  1381.                 {
  1382.                         if (g_iCreditos[client] < amount)
  1383.                                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","NoCredits");
  1384.                         else
  1385.                         {
  1386.                                 g_iCreditos[client] -= amount;
  1387.                                 g_iCreditos[iClient] += amount;
  1388.                        
  1389.                                 CPrintToChat(client, "[ SHOP ] You give \x03%i \x01credits for player: %N", amount, iClient);
  1390.                                 CPrintToChat(iClient, "[ SHOP ] You get \x03%i \x01credits from player: %N", amount, client);
  1391.                         }
  1392.                 }
  1393.         }
  1394.         return Plugin_Continue;
  1395. }
  1396.  
  1397. public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
  1398. {
  1399.         if (g_Godmode[victim] == true)
  1400.         {
  1401.            damage = 0.0;
  1402.            return Plugin_Changed;
  1403.         }
  1404.         else if(IsValidClient(attacker))
  1405.         {
  1406.                 if((vampire[attacker] && GetClientTeam(attacker) != GetClientTeam(victim)))
  1407.                 {
  1408.                         new recibir = RoundToFloor(damage * 0.5);
  1409.                         recibir += GetClientHealth(attacker);
  1410.                         SetEntityHealth(attacker, recibir);
  1411.                 }
  1412.                
  1413.                 if(super_faca[attacker])
  1414.                 {
  1415.                         decl String:weaponName[255];
  1416.                         GetClientWeapon(attacker, weaponName, sizeof(weaponName));
  1417.                         decl String:sGame[255];
  1418.                         GetGameFolderName(sGame, sizeof(sGame));
  1419.                         if (StrEqual(sGame, "cstrike") || StrEqual(sGame, "cstrike_beta"))
  1420.                         {
  1421.                                 if(StrEqual(weaponName, "weapon_knife"))
  1422.                                 {
  1423.                                         DealDamage(victim,100,attacker,DMG_BULLET,weaponName);
  1424.                                 }
  1425.                         }
  1426.                         else if (StrEqual(sGame, "csgo"))
  1427.                         {
  1428.                                 if(StrEqual(weaponName, "weapon_knifegg"))
  1429.                                 {
  1430.                                         DealDamage(victim,100,attacker,DMG_BULLET,weaponName);
  1431.                                 }
  1432.                         }
  1433.                        
  1434.                 }
  1435.                
  1436.         }
  1437.  
  1438.         return Plugin_Continue;
  1439. }
  1440.  
  1441.  
  1442. stock bool:IsValidClient(client, bool:bAlive = false)
  1443. {
  1444.         if(client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
  1445.         {
  1446.                 return true;
  1447.         }
  1448.        
  1449.         return false;
  1450. }
  1451.  
  1452. public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
  1453. {
  1454.         new water = GetEntProp(client, Prop_Data, "m_nWaterLevel");
  1455.         if (IsPlayerAlive(client))
  1456.         {
  1457.                 if (buttons & IN_JUMP)
  1458.                 {
  1459.                         if (water <= 1)
  1460.                         {
  1461.                                 if (!(GetEntityMoveType(client) & MOVETYPE_LADDER))
  1462.                                 {
  1463.                                         SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
  1464.                                         if (!(GetEntityFlags(client) & FL_ONGROUND))
  1465.                                         {
  1466.                                                 if(bhop[client] == true)
  1467.                                                 {
  1468.                                                         buttons &= ~IN_JUMP;   
  1469.                                                 }
  1470.                                         }
  1471.                                 }
  1472.                         }
  1473.                 }
  1474.         }
  1475.        
  1476.         return Plugin_Continue;
  1477. }
  1478.  
  1479.  
  1480.  
  1481. public Action:OnWeaponCanUse(client, weapon)
  1482. {
  1483.         if (g_Ivisivel[client])
  1484.         {
  1485.                 decl String:sClassname[32];
  1486.                 GetEdictClassname(weapon, sClassname, sizeof(sClassname));
  1487.                 if (!StrEqual(sClassname, "weapon_knife"))
  1488.                 return Plugin_Handled;
  1489.         }
  1490.         return Plugin_Continue;
  1491. }
  1492.  
  1493. public OnClientPutInServer(client)
  1494. {
  1495.         SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  1496.         SDKHook(client, SDKHook_WeaponCanUse, OnWeaponCanUse);
  1497. }
  1498.  
  1499. public OnClientPostAdminCheck(client)
  1500. {
  1501.         g_Godmode[client] = false;
  1502.         g_Ivisivel[client] = false;
  1503.         fogo[client] = false;
  1504.         super_faca[client] = false;
  1505.         poison[client] = false;
  1506.         vampire[client] = false;
  1507.         AWP[client] = true;
  1508.         EAGLE[client] = true;
  1509.         view[client] = false;
  1510. }
  1511.  
  1512. public Action:Event_OnRoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
  1513. {
  1514.         for (new i = 1; i <= GetMaxClients(); i++)
  1515.                 if (IsClientInGame(i))
  1516.                         {
  1517.                                 poison[i] = false;
  1518.                                 vampire[i] = false;
  1519.                                 view[i] = false;
  1520.                                 fogo[i] = false;
  1521.                                 super_faca[i] = false;
  1522.                                 bhop[i] = false;
  1523.                                 AWP[i] = true;
  1524.                                 EAGLE[i] = true;
  1525.                         }
  1526. }
  1527.  
  1528. public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  1529. {
  1530.         new client = GetClientOfUserId(GetEventInt(event, "userid"));
  1531.  
  1532.         if (GetClientTeam(client) == 1 && !IsPlayerAlive(client))
  1533.         {
  1534.                 return;
  1535.         }
  1536.  
  1537.         CreateTimer(1.0, MensajesSpawn, client);
  1538.        
  1539. }
  1540.  
  1541. Normalizar(client)
  1542. {
  1543.         if (g_Godmode[client])
  1544.         {
  1545.                 g_Godmode[client] = false;
  1546.         }
  1547.         if (g_Ivisivel[client])
  1548.         {
  1549.                 g_Ivisivel[client] = false;
  1550.                 SDKUnhook(client, SDKHook_SetTransmit, Hook_SetTransmit);  
  1551.         }
  1552.        
  1553.         poison[client] = false;
  1554.         vampire[client] = false;
  1555.         view[client] = false;
  1556.         fogo[client] = false;
  1557.         super_faca[client] = false;
  1558.         bhop[client] = false;
  1559.         AWP[client] = true;
  1560.         EAGLE[client] = true;
  1561. }
  1562.  
  1563. public OnAvailableLR(Announced)
  1564. {
  1565.         for (new i = 1; i <= GetMaxClients(); i++)
  1566.         {
  1567.                 if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
  1568.                 {
  1569.                         if(GetAllPlayersCount() >= GetConVarInt(cvarMinPlayersToGetCredits) && (GetConVarInt(cvarCreditsOnWarmup) != 0 || GameRules_GetProp("m_bWarmupPeriod") != 1) )
  1570.                                 if (IsPlayerReservationAdmin(i))
  1571.                                         g_iCreditos[i] += GetConVarInt(cvarCreditos_LR_VIP);
  1572.                                 else
  1573.                                         g_iCreditos[i] += GetConVarInt(cvarCreditos_LR);
  1574.                         SetEntityGravity(i, 1.0);
  1575.                         Normalizar(i);
  1576.                         SetEntPropFloat(i, Prop_Data, "m_flLaggedMovementValue", 1.0);
  1577.                 }
  1578.         }
  1579. }
  1580.  
  1581.  
  1582. public Action:OpcionNumero16b(Handle:timer, any:client)
  1583. {
  1584.         if ( (IsClientInGame(client)) && (IsPlayerAlive(client)) )
  1585.         {
  1586.            CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Mortal3");
  1587.            g_Godmode[client] = false;
  1588.         }
  1589.  
  1590. }
  1591.  
  1592. public Action:Invisible(Handle:timer, any:client)
  1593. {
  1594.  if ( (IsClientInGame(client)) && (IsPlayerAlive(client)) )
  1595.  {
  1596.    g_Ivisivel[client] = false;
  1597.    CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Visivel novamente");
  1598.    SDKUnhook(client, SDKHook_SetTransmit, Hook_SetTransmit);  
  1599.  }
  1600. }
  1601.  
  1602. public Action:Invisible2(Handle:timer, any:client)
  1603. {
  1604.         if ( (IsClientInGame(client)) && (IsPlayerAlive(client)) )
  1605.         {
  1606.                 CPrintToChat(client, "\x0E[ SHOP ] \x04%t","Visivel novamente");
  1607.                 SetEntityRenderMode(client, RENDER_TRANSCOLOR);
  1608.                 g_Ivisivel[client] = false;
  1609.                 SetEntityRenderColor(client, 255, 255, 255, 255);
  1610.         }
  1611. }
  1612.  
  1613. public Action:abrir()
  1614. {
  1615.     for(new i = 0; i < sizeof(EntityList); i++)
  1616.         while((iEnt = FindEntityByClassname(iEnt, EntityList[i])) != -1)
  1617.             AcceptEntityInput(iEnt, "Open");
  1618.     return Plugin_Handled;
  1619. }
  1620.  
  1621.  
  1622. public Action:Hook_SetTransmit(entity, client)  
  1623. {  
  1624.     if (entity != client)  
  1625.         return Plugin_Handled;
  1626.      
  1627.     return Plugin_Continue;  
  1628. }
  1629.  
  1630.  
  1631. public Action:Command_ShowCredits(client, args)
  1632. {
  1633.         decl String:sName[MAX_NAME_LENGTH], String:sUserId[10];
  1634.        
  1635.         new Handle:menu = CreateMenu(MenuHandlerShowCredits);
  1636.         SetMenuTitle(menu, "%t","Players Credits");
  1637.        
  1638.         for(new i=1;i<=MaxClients;i++)
  1639.         {
  1640.                 if (IsClientInGame(i))
  1641.                 {
  1642.                         GetClientName(i, sName, sizeof(sName));
  1643.                         IntToString(GetClientUserId(i), sUserId, sizeof(sUserId));
  1644.                         decl String:buffer[255];
  1645.                         Format(buffer, sizeof(buffer), "%s: %d", sName, g_iCreditos[i]);
  1646.                         AddMenuItem(menu, sUserId, buffer, ITEMDRAW_DISABLED );                 //sUserID to id_usera, a sName to nick ktory sie wyswietla w Menu
  1647.                 }
  1648.         }
  1649.        
  1650.         SetMenuExitButton(menu, true);
  1651.         DisplayMenu(menu, client, 20);
  1652.        
  1653.         return Plugin_Handled;
  1654. }
  1655.  
  1656. public MenuHandlerShowCredits(Handle:menu, MenuAction:action, param1, param2)
  1657. {
  1658.  
  1659. }
  1660.  
  1661. GetAllPlayersCount()
  1662. {
  1663.   decl iCount, i; iCount = 0;
  1664.  
  1665.   for( i = 1; i <= MaxClients; i++ )
  1666.     if( IsClientInGame( i ) && !IsFakeClient(i) )
  1667.       iCount++;
  1668.   return iCount;
  1669. }
  1670.  
  1671. bool:IsPlayerReservationAdmin(client)
  1672. {
  1673.     if (CheckCommandAccess(client, "Admin_Reservation", ADMFLAG_RESERVATION, false))
  1674.     {
  1675.         return true;
  1676.     }
  1677.     return false;
  1678. }
  1679.  
  1680.