Advertisement
Guest User

Jailbreak CSGO

a guest
Nov 27th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 26.85 KB | None | 0 0
  1. //#include <morecolors>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4. #include <cstrike>
  5. #include <smlib>
  6. #include <hosties>
  7. #include <lastrequest>
  8.  
  9. #define terrorist           2
  10. #define counterTerrorist    3
  11.  
  12.  
  13.  
  14. //new String:g_sLogsPath[PLATFORM_MAX_PATH];
  15. new PlayerKillScore[MAXPLAYERS+1];
  16. new ouivip[MAXPLAYERS+1];
  17. new bool:vipfirstround[MAXPLAYERS+1];
  18. new ChefDesCT[MAXPLAYERS+1];
  19. new CT[MAXPLAYERS+1];
  20. new NombreChef;
  21. new NombreCT;
  22. new VipDesCT[MAXPLAYERS+1];
  23. new VipChef;
  24. new AdminDesCT[MAXPLAYERS+1];
  25. new AdminChef;
  26. new ChefCT;
  27. new roundfirst;
  28. new DecompteJail[MAXPLAYERS+1];
  29. new flag_spawnFirst[MAXPLAYERS+1];
  30. //new Handle:g_hTimerSpawn;
  31. new Handle:g_hTimerMenuJail[MAXPLAYERS+1];
  32.  
  33. new offsetOne;
  34. new offsetTwo;
  35. new offsetThree;
  36. new offsetFour;
  37.  
  38. new g_offsCollisionGroup;
  39. new bool:g_bTPOn[MAXPLAYERS+1];
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. public Plugin:myinfo =
  48. {
  49.     name = "JailBreak For SE",
  50.     description = "JailBreak Mod",
  51.     author = "Dertione",
  52.     version = "1.0",
  53.     url = "http://forum.supreme-elite.fr"
  54. };
  55.  
  56.  
  57.  
  58. public OnPluginStart()
  59. {
  60.     g_offsCollisionGroup = FindSendPropOffs("CBaseEntity", "m_CollisionGroup");
  61.     //CreateLogPath();
  62.     HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode:1);
  63.     HookEvent("player_death", Event_PlayerDeath, EventHookMode:0);
  64.     HookEvent("round_start", Event_RoundStart, EventHookMode:1);
  65.     HookEvent("player_hurt", Event_PlayerHurt);
  66.     RegAdminCmd("sm_ft", CMD_FT, ADMFLAG_SLAY, "sm_ft <#userid|name> [team]");
  67.     RegAdminCmd("sm_color", CMD_color, ADMFLAG_SLAY, "sm_color <#userid|name> [color]");
  68.     RegAdminCmd("sm_colorstop", CMD_colorstop, ADMFLAG_SLAY, "sm_colorstop");
  69.     RegAdminCmd("sm_knive", CMD_knive, ADMFLAG_SLAY, "sm_knive <#userid|name>");
  70.     RegConsoleCmd("tp", Command_ThirdPerson, "Commande pour la vue a la troisième personne");
  71.     //RegConsoleCmd("sm_regle", CMD_regle);
  72.    
  73.     //-----------------------------------------
  74.     // Create our ConVars
  75.     //-----------------------------------------
  76.    
  77.     CreateConVar( "sm_jt", "1", "Enables the jail team ratio plugin.", FCVAR_PLUGIN );
  78.     CreateConVar( "sm_jt_ratio", "2", "The ratio of terrorists to counter-terrorists. (Default: 1CT = 3T)", FCVAR_PLUGIN );
  79.     CreateConVar( "sm_jt_version", "1.0.3", "There is no need to change this value.", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY );
  80.  
  81.     //-----------------------------------------
  82.     // Generate config file
  83.     //-----------------------------------------
  84.    
  85.     AutoExecConfig( true, "sm_jailteams" );
  86.    
  87.     //-----------------------------------------
  88.     // Hook into join team command
  89.     //-----------------------------------------
  90.    
  91.     AddCommandListener(Command_JoinTeam, "jointeam");
  92.    
  93.     //-----------------------------------------
  94.     // No block
  95.     //-----------------------------------------
  96.    
  97.     g_offsCollisionGroup = FindSendPropOffs("CBaseEntity", "m_CollisionGroup");
  98. }
  99.  
  100. public OnMapStart()
  101. {
  102.    
  103.     for (new i = 1; i <= 64; i++)
  104.     {
  105.         vipfirstround[i]=true;
  106.     }
  107.     //LoadLogPath();
  108.     roundfirst = 5;
  109.  
  110. }
  111.  
  112.  
  113. public OnClientPutInServer(client)
  114. {
  115.     if(IsAdmin(client))
  116.     {
  117.         SetClientListeningFlags(client, VOICE_NORMAL);
  118.     }
  119.     else
  120.     {
  121.         SetClientListeningFlags(client, VOICE_MUTED);
  122.     }
  123.    
  124.     flag_spawnFirst[client] = 1;
  125.     g_bTPOn[client] = false;
  126.     g_hTimerMenuJail[client] = CreateTimer(1.0, TimerSec , client, TIMER_REPEAT);
  127. }
  128.  
  129. public OnClientDisconnect(client)
  130. {
  131.     if (g_hTimerMenuJail[client] != INVALID_HANDLE)
  132.     {
  133.         KillTimer(g_hTimerMenuJail[client])
  134.         g_hTimerMenuJail[client] = INVALID_HANDLE
  135.     }
  136. }
  137.  
  138.  
  139.  
  140.  
  141. public Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
  142. {
  143.     new client = GetClientOfUserId(GetEventInt(event,"userid")),
  144.     attacker = GetClientOfUserId(GetEventInt(event,"attacker"));
  145.     new damage = GetEventInt(event,"dmg_health");
  146.     decl String:VictimeName[64];
  147.     GetClientName(client, VictimeName, 64);
  148.     decl String:VictimeAuth[64];
  149.     GetClientAuthString(client, VictimeAuth, 64);
  150.     decl String:AttackerName[64];
  151.     GetClientName(attacker, AttackerName, 64);
  152.     decl String:AttackerAuth[64];
  153.     GetClientAuthString(client, AttackerAuth, 64);
  154.     if(attacker)
  155.     {
  156.         new team = GetClientTeam(attacker);
  157.         decl String:weapon[10];
  158.         GetEventString(event,"weapon", weapon, sizeof(weapon));
  159.         new i = 1;
  160.  
  161.         while (GetMaxClients() >= i)
  162.         {
  163.             if (IsClientInGame(i))
  164.             {
  165.                 if (IsAdmin(i)||IsRoot(i))
  166.                 {
  167.                     PrintToConsole(i, "                 [JailBreak Mod] Damage - Anti freeshot");
  168.                     PrintToConsole(i, "                 %s(%s) (team=%i) a toucher %s(%s) ! with %s  with %i HP", AttackerName, AttackerAuth, team, VictimeName, VictimeAuth,weapon, damage);
  169.                     i++;
  170.                 }
  171.                 else
  172.                 {
  173.                     i++;
  174.                 }
  175.             }
  176.             else
  177.             {
  178.                 i++;
  179.             }
  180.         }
  181.     }
  182.  
  183.    
  184.    
  185. }
  186.  
  187. public Action:Command_JoinTeam(client, const String:command[], argc)
  188. {
  189.     //-----------------------------------------
  190.     // Get the CVar T:CT ratio
  191.     //-----------------------------------------
  192.  
  193.     new teamRatio = 2 ;
  194.    
  195.     //-----------------------------------------
  196.     // Is it a human?
  197.     //-----------------------------------------
  198.    
  199.     if ( ! client || ! IsClientInGame( client ) || IsFakeClient( client ) )
  200.     {
  201.         return Plugin_Continue;
  202.     }
  203.    
  204.     //-----------------------------------------
  205.     // Get new and old teams
  206.     //-----------------------------------------
  207.    
  208.     decl String:teamString[3];
  209.     GetCmdArg( 1, teamString, sizeof( teamString ) );
  210.    
  211.     new newTeam = StringToInt(teamString);
  212.     new oldTeam = GetClientTeam(client);
  213.    
  214.     //-----------------------------------------
  215.     // Bypass for SM admins
  216.     //-----------------------------------------
  217.    
  218.     if ( IsAdmin(client))
  219.     {
  220.         PrintToChat( client, "\x03[SE] \x04Admin, Bypass", teamRatio );
  221.         //PrintCenterText(client, "Admin, Bypass");
  222.         return Plugin_Continue;
  223.     }
  224.    
  225.     if(newTeam == 0)
  226.     {
  227.         PrintToChat( client, "\x03[SE] \x04Choix automatique DESACTIVER !!", teamRatio );
  228.         //PrintCenterText(client, "Choix automatique DESACTIVER !!");
  229.         return Plugin_Handled;
  230.     }
  231.    
  232.    
  233.     //-----------------------------------------
  234.     // Are we trying to switch to CT?
  235.     //-----------------------------------------
  236.    
  237.     if ( newTeam == counterTerrorist && oldTeam != counterTerrorist )
  238.     {
  239.         new countTs     = 0;
  240.         new countCTs    = 0;
  241.        
  242.         //-----------------------------------------
  243.         // Count up our players!
  244.         //-----------------------------------------
  245.        
  246.         countTs=Team_GetClientCountAll(2,0);
  247.         countCTs=Team_GetClientCountAll(3,0);
  248.        
  249.         //-----------------------------------------
  250.         // Are we trying to unbalance the ratio?
  251.         //-----------------------------------------
  252.  
  253.         if ( countCTs < ( ( countTs ) / teamRatio ) || ! countCTs || IsRoot(client) || IsAdmin(client))
  254.         {
  255.             return Plugin_Continue;
  256.         }
  257.         else
  258.         {
  259.             //-----------------------------------------
  260.             // Send client sound
  261.             //-----------------------------------------
  262.            
  263.             ClientCommand( client, "play ui/freeze_cam.wav" );
  264.            
  265.             //-----------------------------------------
  266.             // Show client message
  267.             //-----------------------------------------
  268.            
  269.             //PrintCenterText(client, "l'equipe est pleine !");
  270.  
  271.             //-----------------------------------------
  272.             // Kill the team change request
  273.             //-----------------------------------------
  274.  
  275.             return Plugin_Handled;
  276.         }      
  277.     }
  278.    
  279.     return Plugin_Continue;
  280. }
  281.  
  282. public Action:Event_PlayerSpawn(Handle:event, String:name[], bool:dontBroadcast)
  283. {
  284.     new client = GetClientOfUserId(GetEventInt(event, "userid"));
  285.     if (!IsFakeClient(client) && IsClientConnected(client))
  286.     {
  287.         if(GetClientTeam(client) == 2)
  288.         {
  289.             PlayerKillScore[client] = 0;
  290.         }
  291.         else
  292.         {
  293.             PlayerKillScore[client] = 3;
  294.         }
  295.     }
  296.    
  297.     SetClientListeningFlags(client, VOICE_MUTED);
  298.     if (GetPlayerWeaponSlot(client, 0) != -1) RemovePlayerItem(client, GetPlayerWeaponSlot(client, 0));
  299.     if (GetPlayerWeaponSlot(client, 1) != -1) RemovePlayerItem(client, GetPlayerWeaponSlot(client, 1));
  300.     SetEntData(client, g_offsCollisionGroup, 2, 4, true);
  301.     if (IsAdmin(client))
  302.     {
  303.         if(GetClientTeam(client) == 3)
  304.         {
  305.             if (GetPlayerWeaponSlot(client, 1) != -1) RemovePlayerItem(client, GetPlayerWeaponSlot(client, 1));
  306.             GivePlayerItem(client, "weapon_deagle", 0);
  307.         }
  308.         SetClientListeningFlags(client, VOICE_NORMAL);
  309.     }
  310.     if (GetClientTeam(client) == 2 && !IsAdmin(client) && !IsRoot(client) )
  311.     {
  312.         SetClientListeningFlags(client, VOICE_MUTED);
  313.     }
  314.     if (GetClientTeam(client) == 3 || IsAdmin(client) || IsRoot(client))
  315.     {
  316.         SetClientListeningFlags(client, VOICE_NORMAL);
  317.         if(GetClientTeam(client) == 3)
  318.         {
  319.             SetEntProp(client, PropType:0, "m_ArmorValue", any:100, 1);
  320.             SetEntProp(client, PropType:0, "m_bHasHelmet", any:1, 1);
  321.             GivePlayerItem(client, "weapon_m4a1", 0);
  322.         }
  323.     }
  324.     if(flag_spawnFirst[client] == 1 && ((IsVIP(client) || IsAdmin(client))))
  325.     {
  326.         ouivip[client] = 1;
  327.         flag_spawnFirst[client] = 0;
  328.     }
  329. }
  330.  
  331.  
  332.  
  333. ///////////////////////////////////////////////////////////////////////////////////
  334. /////////////////// Menu du Chef des CT en debut de round /////////////////////////
  335. ///////////////////////////////////////////////////////////////////////////////////
  336.  
  337.  
  338.  
  339. public Action:Event_RoundStart(Handle:event, String:name[], bool:dontBroadcast)
  340. {
  341.     NombreChef = 0;
  342.     VipChef = 0;
  343.     AdminChef = 0;
  344.     roundfirst--;
  345.     new String:ChefCTName[64];
  346.     ChefCTName="...";
  347.     CreateTimer(5.0, timer_menu);
  348.     for (new i = 1; i <= GetMaxClients(); i++)
  349.     {
  350.         if(IsClientConnected(i))
  351.         {
  352.             DecompteJail[i] = 55;
  353.         }
  354.     }
  355. }
  356.  
  357. public Action:timer_menu(Handle:timer)
  358. {
  359.     MenuChefCT();
  360. }
  361.  
  362. public MenuHandler1(Handle:menu, MenuAction:action, client, param2)
  363. {
  364.     if (action == MenuAction_Select)
  365.     {
  366.         NombreCT = NombreCT + 1;
  367.         if(NombreCT<=MAXPLAYERS)
  368.         {
  369.             CT[NombreCT] = client ;
  370.         }
  371.         if(param2==0)
  372.         {
  373.             NombreChef += 1;
  374.             ChefDesCT[NombreChef] = client;
  375.             PrintToChat(client, "Merci, veuillez patienter, tirage au sort en cours !");
  376.         }
  377.         else if(param2==1)
  378.         {
  379.            
  380.         }
  381.         else if(param2==2)
  382.         {
  383.             VipChef += 1;
  384.             VipDesCT[VipChef] = client;
  385.         }
  386.         else if(param2==3)
  387.         {
  388.             LogAction(client, -1, "\"%L\" a selectionné le oui(admin)", client);
  389.             AdminChef += 1;
  390.             AdminDesCT[AdminChef] = client;
  391.         }
  392.     }
  393.     /* If the menu has ended, destroy it */
  394.     else if (action == MenuAction_End)
  395.     {
  396.         CloseHandle(menu);
  397.     }
  398. }
  399.  
  400. stock MenuChefCT()
  401. {
  402.     for (new i = 1; i <= GetMaxClients(); i++)
  403.     {
  404.         if (IsClientInGame(i))
  405.         {
  406.             if (GetClientTeam(i) == 3)
  407.             {
  408.                 new Handle:menu = CreateMenu(MenuHandler1);
  409.                 SetMenuTitle(menu, "Veux-tu être chef des CT ?");
  410.                 AddMenuItem(menu, "oui", "Oui");
  411.                 AddMenuItem(menu, "non", "Non");
  412.                 if(ouivip[i]>0)
  413.                 {
  414.                     AddMenuItem(menu, "ouivip", "Oui (vip)");
  415.                 }
  416.                 if(IsAdmin(i)||IsRoot(i))
  417.                 {
  418.                     AddMenuItem(menu, "ouiadmin", "Oui (admin)");
  419.                 }
  420.                 SetMenuExitButton(menu, false);
  421.                 if(IsClientConnected(i))
  422.                 {
  423.                     DisplayMenu(menu, i, 6);
  424.                 }
  425.             }
  426.             //WelcomeTimers = CreateTimer(2.5, ChefCTMenuTableau, i, TIMER_REPEAT);
  427.         }
  428.        
  429.     }
  430.     CreateTimer(15.0,ChefCTMenuFin);
  431. }
  432.  
  433.  
  434.  
  435.  
  436.  
  437. public Action:TimerSec(Handle:timer, any:client)
  438. {
  439.     new totalCT;
  440.     new totalT;
  441.     new totalCTAlive;
  442.     new totalTAlive;
  443.     if (0 < DecompteJail[client])
  444.     {
  445.         DecompteJail[client] -= 1;
  446.     }
  447.     totalTAlive = Team_GetClientCountAlive(2,0);
  448.     totalCTAlive = Team_GetClientCountAlive(3,0);
  449.     totalT = Team_GetClientCountAll(2,0);
  450.     totalCT = Team_GetClientCountAll(3,0);
  451.     if (totalTAlive <= 5 && totalTAlive >= 4)
  452.     {
  453.         new r = 1;
  454.         while (GetMaxClients() >= r)
  455.         {
  456.             if (IsClientInGame(r)&&IsPlayerAlive(r))
  457.             {
  458.                 SetClientListeningFlags(r, 0);
  459.                 r++;
  460.             }
  461.             r++;
  462.         }
  463.     }
  464.     if (IsClientConnected(client))
  465.     {
  466.         new String:Text[256];
  467.         Format(Text, 254, "");
  468.         if (DecompteJail[client])
  469.         {
  470.             //Format(Text, 254, "%s\n", Text);
  471.         }
  472.         if (ChefCT)
  473.         {
  474.             new String:ChefCTName[64];
  475.             if(IsClientInGame(ChefCT))
  476.             {
  477.                 GetClientName(ChefCT, ChefCTName, 64);
  478.                 Format(Text, 254, "%Chef Gardiens : %s\n", ChefCTName);
  479.             }
  480.             else
  481.             {
  482.                 Format(Text, 254, "Chef Gardiens : ...\n");
  483.             }
  484.         }
  485.         else
  486.         {
  487.             Format(Text, 254, "Chef Gardiens : ...\n");
  488.         }
  489.         Format(Text, 254, "%sGardiens : %i / %i\n", Text, totalCTAlive, totalCT);
  490.         Format(Text, 254, "%sPrisonniers : %i / %i\n", Text, totalTAlive, totalT);
  491.         new Talk = GetClientListeningFlags(client);
  492.         if (Talk == VOICE_MUTED)
  493.         {
  494.             Format(Text, 254, "%sMicrophone [MUTE]\n", Text);
  495.         }
  496.         else
  497.         {
  498.             Format(Text, 254, "%sMicrophone [ACTIF]\n", Text);
  499.         }
  500.         if (DecompteJail[client])
  501.         {
  502.             Format(Text, 254, "%sOuverture auto dans %i sec\n", Text, DecompteJail[client]);
  503.         }
  504.         //Format(Text, 254, "%s\n", Text);
  505.         PrintHintText(client, "%s", Text);
  506.     }
  507.     else
  508.     {
  509.         if (g_hTimerMenuJail[client] != INVALID_HANDLE)
  510.         {
  511.             KillTimer(g_hTimerMenuJail[client])
  512.             g_hTimerMenuJail[client] = INVALID_HANDLE
  513.         }
  514.     }
  515. }
  516.  
  517.  
  518.  
  519.  
  520.  
  521. public Action:ChefCTMenuFin(Handle:timer)
  522. {
  523.     if(AdminChef>0)
  524.     {
  525.         ChefCT=AdminDesCT[1];
  526.     }
  527.     else if(VipChef>0)
  528.     {
  529.         ChefCT = VipDesCT[GetRandomInt(1, VipChef)];
  530.         ouivip[ChefCT]=0;
  531.     }
  532.     else
  533.     {
  534.         new i = 1;
  535.         while (GetMaxClients() >= i)
  536.         {
  537.             if (IsClientInGame(i))
  538.             {
  539.                 if (GetClientTeam(i) == 3 && IsPlayerAlive(i))
  540.                 {
  541.                     NombreChef += 1;
  542.                     ChefDesCT[NombreChef] = i;
  543.                     i++;
  544.                 }
  545.                 i++;
  546.             }
  547.             i++;
  548.         }
  549.         ChefCT = ChefDesCT[GetRandomInt(1, NombreChef)];
  550.     }
  551.     new String:ChefCTName[64];
  552.     GetClientName(ChefCT, ChefCTName, 64);
  553.     PrintToChatAll("\x04%s \x03est le chef des gardiens !", ChefCTName);
  554.     //PrintCenterTextAll("%s est le chef des gardiens !", ChefCTName);
  555.     PrintHintTextToAll("%s est le chef des gardiens !", ChefCTName);
  556.     VipChef = 0;
  557.     AdminChef = 0;
  558.     NombreChef = 0;
  559. }
  560.  
  561. ///////////////////////////////////////////////////////////////////////////////////
  562. ///////////////  fin du Menu du Chef des CT en debut de round /////////////////////
  563. ///////////////////////////////////////////////////////////////////////////////////
  564.  
  565.  
  566.  
  567. public Action:AlertDernierCT(Handle:timer)
  568. {
  569.     new totalCTAlive = 0;
  570.     new i = 1;
  571.     while (GetMaxClients() >= i)
  572.     {
  573.         if (IsClientInGame(i))
  574.         {
  575.             if (GetClientTeam(i) == 3)
  576.             {
  577.                 totalCTAlive++;
  578.                 i++;
  579.             }
  580.             i++;
  581.         }
  582.         i++;
  583.     }
  584.     if (totalCTAlive == 1)
  585.     {
  586.         PrintToChatAll("! Dernier gardien en vie ! ");
  587.         //PrintCenterTextAll("Dernier gardien en vie !");
  588.     }
  589.     return Plugin_Continue;
  590. }
  591.  
  592.  
  593. public Action:Event_PlayerDeath(Handle:event, String:name[], bool:dontBroadcast)
  594. {
  595.     new client = GetClientOfUserId(GetEventInt(event, "userid"));
  596.     new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  597.     if (IsRoot(client)||IsAdmin(client))
  598.     {
  599.         SetClientListeningFlags(client, VOICE_NORMAL);
  600.     }
  601.     else
  602.     {
  603.         SetClientListeningFlags(client, VOICE_MUTED);
  604.     }
  605.     decl String:AttackerWeapon[64];
  606.     GetEventString(event, "weapon", AttackerWeapon, 64);
  607.     if (StrEqual(AttackerWeapon, "knife", true))
  608.     {
  609.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 1;
  610.     }
  611.     if (StrEqual(AttackerWeapon, "glock18", true))
  612.     {
  613.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 2;
  614.     }
  615.     if (StrEqual(AttackerWeapon, "usp", true))
  616.     {
  617.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 2;
  618.     }
  619.     if (StrEqual(AttackerWeapon, "p228", true))
  620.     {
  621.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 2;
  622.     }
  623.     if (StrEqual(AttackerWeapon, "deagle", true))
  624.     {
  625.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 2;
  626.     }
  627.     if (StrEqual(AttackerWeapon, "fiveseven", true))
  628.     {
  629.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 2;
  630.     }
  631.     if (StrEqual(AttackerWeapon, "elite", true))
  632.     {
  633.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 2;
  634.     }
  635.     if (StrEqual(AttackerWeapon, "hegrenade", true))
  636.     {
  637.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 2;
  638.     }
  639.     if (StrEqual(AttackerWeapon, "ak47", true))
  640.     {
  641.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  642.     }
  643.     if (StrEqual(AttackerWeapon, "m4a1", true))
  644.     {
  645.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  646.     }
  647.     if (StrEqual(AttackerWeapon, "mp5navy", true))
  648.     {
  649.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  650.     }
  651.     if (StrEqual(AttackerWeapon, "awp", true))
  652.     {
  653.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  654.     }
  655.     if (StrEqual(AttackerWeapon, "sg522", true))
  656.     {
  657.         PlayerKillScore[attacker] = PlayerKillScore[attacker]+ 3;
  658.     }
  659.     if (StrEqual(AttackerWeapon, "aug", true))
  660.     {
  661.         PlayerKillScore[attacker] = PlayerKillScore[attacker]+ 3;
  662.     }
  663.     if (StrEqual(AttackerWeapon, "scout", true))
  664.     {
  665.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  666.     }
  667.     if (StrEqual(AttackerWeapon, "sg550", true))
  668.     {
  669.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  670.     }
  671.     if (StrEqual(AttackerWeapon, "g3sg1", true))
  672.     {
  673.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  674.     }
  675.     if (StrEqual(AttackerWeapon, "mac10", true))
  676.     {
  677.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  678.     }
  679.     if (StrEqual(AttackerWeapon, "tmp", true))
  680.     {
  681.         PlayerKillScore[attacker] = PlayerKillScore[attacker]+ 3;
  682.     }
  683.     if (StrEqual(AttackerWeapon, "ump45", true))
  684.     {
  685.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  686.     }
  687.     if (StrEqual(AttackerWeapon, "p90", true))
  688.     {
  689.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  690.     }
  691.     if (StrEqual(AttackerWeapon, "m3", true))
  692.     {
  693.         PlayerKillScore[attacker] = PlayerKillScore[attacker]+ 3;
  694.     }
  695.     if (StrEqual(AttackerWeapon, "xm1014", true))
  696.     {
  697.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  698.     }
  699.     if (StrEqual(AttackerWeapon, "m249", true))
  700.     {
  701.         PlayerKillScore[attacker] = PlayerKillScore[attacker] + 3;
  702.     }
  703.     new String:VictimeName[64];
  704.     GetClientName(client, VictimeName, 64);
  705.     new String:VictimeAuth[64];
  706.     GetClientAuthString(client, VictimeAuth, 64);
  707.     new String:AttackerName[64];
  708.     GetClientName(attacker, AttackerName, 64);
  709.     new String:AttackerAuth[64];
  710.     GetClientAuthString(client, AttackerAuth, 64);
  711.     new i = 1;
  712.     while (GetMaxClients() >= i)
  713.     {
  714.         if (IsClientConnected(i))
  715.         {
  716.             if (GetUserFlagBits(i) & 16384)
  717.             {
  718.                 PrintToConsole(i, " ");
  719.                 PrintToConsole(i, "   [JailBreak Mod] Kill");
  720.                 PrintToConsole(i, "       %s(%s) a tue %s(%s) !", AttackerName, AttackerAuth, VictimeName, VictimeAuth);
  721.                 PrintToConsole(i, " ");
  722.                 i++;
  723.             }
  724.             i++;
  725.         }
  726.         i++;
  727.     }
  728.     if (GetClientTeam(client) == 3 && IsClientConnected(attacker))
  729.     {
  730.         PrintToChatAll("\x04 -=> Un gardien vient d'être tué ! <=-");
  731.         if(GetClientTeam(attacker)==2 && PlayerKillScore[attacker]<3)
  732.         {
  733.             SetEventInt(event, "attacker", 0);
  734.             SetEventString(event, "weapon", "");
  735.             SetEventBool(event, "headshot", false);
  736.             SetEventInt(event, "dominated", 0);
  737.             SetEventInt(event, "revenge", 0);
  738.             return Plugin_Changed;
  739.         }
  740.        
  741.         new totalCTAlive;
  742.         i = 1;
  743.         while (GetMaxClients() >= i)
  744.         {
  745.             if (IsClientInGame(i))
  746.             {
  747.                 if (GetClientTeam(i) == 3)
  748.                 {
  749.                     totalCTAlive++;
  750.                     i++;
  751.                 }
  752.             }
  753.             i++;
  754.         }
  755.         if (client == ChefCT)
  756.         {
  757.             ChefCT = 0;
  758.             NombreChef = 0;
  759.             CreateTimer(1.0, ChefCTMenuFin, any:0, 0);
  760.         }
  761.         if (totalCTAlive == 1)
  762.         {
  763.             CreateTimer(1.0, AlertDernierCT, any:0, 0);
  764.             CreateTimer(6.0, AlertDernierCT, any:0, 0);
  765.             CreateTimer(12.0, AlertDernierCT, any:0, 0);
  766.         }
  767.     }
  768.     if (GetClientTeam(client) == 2)
  769.     {
  770.         new totalTAlive;
  771.         i = 1;
  772.         while (GetMaxClients() >= i)
  773.         {
  774.             if (IsClientInGame(i))
  775.             {
  776.                 if (GetClientTeam(i) == 2)
  777.                 {
  778.                     totalTAlive++;
  779.                     i++;
  780.                 }
  781.             }
  782.             i++;
  783.         }
  784.         if (totalTAlive == 5)
  785.         {
  786.             PrintToChatAll("[JAILBEAK-SE] Les prisonniers ont été démutes !");
  787.         }
  788.     }
  789.    
  790.     return Plugin_Continue;
  791. }
  792.  
  793.  
  794.  
  795.  
  796. /*public Action:CMD_regle(client, args)
  797. {
  798.     CreateTimer(1.0, Timer_Motd, client);
  799. }
  800.  
  801. public Action:Timer_Motd(Handle:timer, any:client)
  802. {
  803.     decl String:MotdURL[256];
  804.     Format(MotdURL, 256, "http://s.supreme-elite.fr/regle/reglese.html");
  805.     ShowMOTDPanel(client, "Les regles du JailBreak", MotdURL, 2);
  806. }*/
  807.  
  808.  
  809. public Action:CMD_FT(client, args)
  810. {
  811.     if (args < 2 )
  812.     {
  813.         ReplyToCommand(client, "[SM] Usage : sm_ft <name> <team>");
  814.         return Plugin_Handled ;
  815.     }
  816.     new Alive;
  817.     new ThePlayer;
  818.     decl String:sArg1[64];
  819.     decl String:sArg2[64];
  820.     GetCmdArg(1, sArg1, sizeof(sArg2));
  821.     GetCmdArg(2, sArg2, sizeof(sArg2));
  822.     if (IsAdmin(client)||IsRoot(client))
  823.     {
  824.         if (!StrEqual(sArg1, "", true))
  825.         {
  826.             ThePlayer = FindTarget(client,sArg1, false, false);
  827.             if (IsPlayerAlive(ThePlayer))
  828.             {
  829.                 Alive = 1;
  830.             }
  831.             if (ThePlayer)
  832.             {
  833.                 new String:name[64];
  834.                 GetClientName(ThePlayer, name, 64);
  835.                 if (StrEqual(sArg2, "1", true))
  836.                 {
  837.                     ChangeClientTeam(ThePlayer, 1);
  838.                     PrintToChatAll("[JAILBEAK-SE] Le joueur %s a été swapé en spectateur ", name);
  839.                     LogAction(client, ThePlayer, "\"%L\" a ft \"%L\" (team : \"%s\")", client, ThePlayer, sArg2);
  840.                 }
  841.                 if (StrEqual(sArg2, "2", true))
  842.                 {
  843.                     ChangeClientTeam(ThePlayer, 2);
  844.                     PrintToChatAll("[JAILBEAK-SE] Le joueur %s a été swapé en terroriste ", name);
  845.                     if (Alive == 1)
  846.                     {
  847.                         CS_RespawnPlayer(ThePlayer);
  848.                         LogAction(client, ThePlayer, "\"%L\" a ft \"%L\" (team : \"%s\") (la personne est toujours en vie)", client, ThePlayer, sArg2);
  849.                     }
  850.                     else
  851.                     {
  852.                         LogAction(client, ThePlayer, "\"%L\" a ft \"%L\" (team : \"%s\") (la personne est morte)", client, ThePlayer, sArg2);
  853.                     }
  854.                 }
  855.                 if (StrEqual(sArg2, "3", true))
  856.                 {
  857.                     ChangeClientTeam(ThePlayer, 3);
  858.                     PrintToChatAll("[JAILBEAK-SE] Le joueur %s a été swapé en anti-terroriste ", name);
  859.                     if (Alive == 1)
  860.                     {
  861.                         CS_RespawnPlayer(ThePlayer);
  862.                         LogAction(client, ThePlayer, "\"%L\" a ft \"%L\" (team : \"%s\") (la personne est toujours en vie)", client, ThePlayer, sArg2);
  863.                     }
  864.                     else
  865.                     {
  866.                         LogAction(client, ThePlayer, "\"%L\" a ft \"%L\" (team : \"%s\") (la personne est morte)", client, ThePlayer, sArg2);
  867.                     }
  868.                 }
  869.             }
  870.             else
  871.             {
  872.                 PrintToChat(client, "[JAILBEAK-SE] Joueur introuvable", sArg1);
  873.             }
  874.         }
  875.         else
  876.         {
  877.             PrintToChat(client, "[JAILBEAK-SE] Erreur");
  878.         }
  879.         return Action:3;
  880.     }
  881.     PrintToChat(client, "[JAILBEAK-SE] Tu n'as pas les droits nécessaires ");
  882.     return Plugin_Handled;
  883. }
  884.  
  885. public Action:CMD_color(client, args)
  886. {
  887.     if (args < 2 )
  888.     {
  889.         ReplyToCommand(client, "[SM] Usage : sm_color <name> <color>");
  890.         return Plugin_Handled;
  891.     }
  892.     new ThePlayer;
  893.     decl String:sArg1[64];
  894.     decl String:sArg2[64];
  895.     GetCmdArg(1, sArg1, sizeof(sArg2));
  896.     GetCmdArg(2, sArg2, sizeof(sArg2));
  897.  
  898.     if (IsAdmin(client) || IsRoot(client))
  899.     {
  900.         if (!StrEqual(sArg1, "", true))
  901.         {
  902.             if (StrEqual(sArg1, "terro", true))
  903.             {
  904.                 new p = 1;
  905.                 while (GetMaxClients() >= p)
  906.                 {
  907.                     if (IsPlayerAlive(p))
  908.                     {
  909.                         if(p==0||p==2||p==4||p==6||p==8||p==10||p==12||p==14||p==16)
  910.                         {
  911.                             SetEntityRenderColor(ThePlayer, 0, 0, 0, 255);
  912.                             p++;
  913.                         }
  914.                         else
  915.                         {
  916.                             SetEntityRenderColor(p, 0, 0, 255, 255);
  917.                             p++;
  918.                         }
  919.                     }
  920.                     else
  921.                     {
  922.                         p++;
  923.                     }
  924.                 }
  925.                 LogAction(client, -1, "\"%L\" a coloré tout les terroristes", client);
  926.             }
  927.             else
  928.             {
  929.                 ThePlayer = FindTarget(client,sArg1, false, false);
  930.             }
  931.             if (ThePlayer)
  932.             {
  933.                 if (StrEqual(sArg2, "rouge", true))
  934.                 {
  935.                     SetEntityRenderColor(ThePlayer, 255, 0, 0, 255);
  936.                 }
  937.                 if (StrEqual(sArg2, "bleu", true))
  938.                 {
  939.                     SetEntityRenderColor(ThePlayer, 0, 0, 255, 255);
  940.                 }
  941.                 if (StrEqual(sArg2, "jaune", true))
  942.                 {
  943.                     SetEntityRenderColor(ThePlayer, 255, 240, 0, 255);
  944.                 }
  945.                 if (StrEqual(sArg2, "vert", true))
  946.                 {
  947.                     SetEntityRenderColor(ThePlayer, 0, 138, 0, 255);
  948.                 }
  949.                 if (StrEqual(sArg2, "rose", true))
  950.                 {
  951.                     SetEntityRenderColor(ThePlayer, 255, 180, 180, 255);
  952.                 }
  953.                 if (StrEqual(sArg2, "noir", true))
  954.                 {
  955.                     SetEntityRenderColor(ThePlayer, 0, 0, 0, 255);
  956.                 }
  957.                 decl String:name[64];
  958.                 GetClientName(ThePlayer, name, 64);
  959.                 PrintToChatAll("[JAILBEAK-SE] Tu as coloré %s en %s ", name, sArg2);
  960.                 LogAction(client, ThePlayer, "\"%L\" a coloré \"%L\" en \"%s\"", client, ThePlayer, sArg2);
  961.             }
  962.             else
  963.             {
  964.                 PrintToChatAll("[JAILBEAK-SE] Joueur introuvable ");
  965.             }
  966.         }
  967.         else
  968.         {
  969.             PrintToChat(client, "[JAILBEAK-SE] Erreur de syntaxe : /color name nameofcolour ");
  970.         }
  971.     }
  972.     else
  973.     {
  974.         PrintToChat(client, "[JAILBEAK-SE] Tu n'as pas le droit de colorer ! ");
  975.     }
  976.     return Plugin_Continue;
  977. }
  978.  
  979. public Action:CMD_colorstop(client, args)
  980. {
  981.     if (IsAdmin(client) || IsRoot(client))
  982.     {
  983.         new x = 1;
  984.         while (GetMaxClients() >= x)
  985.         {
  986.             if (IsClientConnected(x))
  987.             {
  988.                 SetEntityRenderColor(x, 255, 255, 255, 255);
  989.                 x++;
  990.             }
  991.             x++;
  992.         }
  993.     }
  994. }
  995.  
  996. public Action:CMD_knive(client, args)
  997. {
  998.     if (args < 1 )
  999.     {
  1000.         ReplyToCommand(client, "[SM] Usage : sm_knive <name>");
  1001.         return Plugin_Handled;
  1002.     }
  1003.     new ThePlayer;
  1004.     decl String:sArg1[64];
  1005.     GetCmdArg(1, sArg1, sizeof(sArg1));
  1006.     if (IsAdmin(client))
  1007.     {
  1008.         ThePlayer = FindTarget(client,sArg1, false, false);
  1009.         if (ThePlayer)
  1010.         {
  1011.             GivePlayerItem(client, "weapon_knife", 0);
  1012.         }
  1013.     }
  1014.     else
  1015.     {
  1016.         PrintToChat(client, "[JAILBEAK-SE] Tu n'as pas le droit de donner des couteaux ! ");
  1017.         return Plugin_Handled;
  1018.     }
  1019.     return Plugin_Continue;
  1020. }
  1021.  
  1022. public Action:Command_ThirdPerson(client, args)
  1023. {
  1024.     if (!IsVIP(client)) PrintToChat(client, "[VIP] Commande réservée aux VIPs");
  1025.     else if (IsClientInLastRequest(client)) PrintToChat(client, "[VIP] Erreur ! Vous êtes en dv");
  1026.     else if (!IsPlayerAlive(client)) PrintToChat(client, "[VIP] Erreur ! Vous êtes mort");
  1027.     else if (!g_bTPOn[client]) SetThirdPersonView(client,true);
  1028.     else SetThirdPersonView(client,false);
  1029. }
  1030.  
  1031. public SetThirdPersonView(client, bool:third)
  1032. {
  1033.     if(third)
  1034.     {
  1035.         SetEntData(client, offsetOne, 0);
  1036.         SetEntData(client, offsetTwo, 1);
  1037.         SetEntData(client, offsetThree, 0);
  1038.         SetEntData(client, offsetFour, 120);
  1039.         g_bTPOn[client] = true;
  1040.        
  1041.     }
  1042.     else
  1043.     {
  1044.        
  1045.         SetEntData(client, offsetOne, 0);
  1046.         SetEntData(client, offsetTwo, 0);
  1047.         SetEntData(client, offsetThree, 1);
  1048.         SetEntData(client, offsetFour, 90);
  1049.         g_bTPOn[client] = false;       
  1050.     }
  1051. }
  1052.  
  1053.  
  1054.  
  1055.  
  1056. public IsVIP(client)
  1057. {
  1058.     decl String:steamId[30];
  1059.     GetClientAuthString(client, steamId, sizeof(steamId));
  1060.     if (GetUserFlagBits(client) & ADMFLAG_CUSTOM1) return true;
  1061.     else return false;
  1062. }
  1063.  
  1064. public IsRoot(client)
  1065. {
  1066.     decl String:steamId[30];
  1067.     GetClientAuthString(client, steamId, sizeof(steamId));
  1068.     if (GetUserFlagBits(client) & ADMFLAG_ROOT) return true;
  1069.     else return false;
  1070. }
  1071.  
  1072. public IsAdmin(client)
  1073. {
  1074.     decl String:steamId[30];
  1075.     GetClientAuthString(client, steamId, sizeof(steamId));
  1076.     if (GetUserFlagBits(client) & ADMFLAG_SLAY) return true;
  1077.     else if (GetUserFlagBits(client) & ADMFLAG_GENERIC) return true;
  1078.     else if (GetUserFlagBits(client) & ADMFLAG_BAN) return true;
  1079.     else return false;
  1080. }
  1081.  
  1082. stock Team_GetPlayerAlive(team, flags=0)
  1083. {
  1084.     flags |= CLIENTFILTER_INGAME;
  1085.  
  1086.     new numClients = 0;
  1087.     for (new client=1; client <= MaxClients; client++) {
  1088.  
  1089.         if (!Client_MatchesFilter(client, flags)) {
  1090.             continue;
  1091.         }
  1092.  
  1093.         if (GetClientTeam(client) == team&&IsPlayerAlive(client)) {
  1094.             numClients++;
  1095.         }
  1096.     }
  1097.  
  1098.     return numClients;
  1099. }
  1100.  
  1101.  
  1102. stock All_GetPlayer()
  1103. {
  1104.     new count;
  1105.     for(new i=1; i <= GetMaxClients(); i++)
  1106.     {
  1107.         if (IsClientInGame(i) && GetClientTeam(i) > 1)
  1108.         {
  1109.             count++;
  1110.         }
  1111.     }
  1112.     return count;
  1113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement