Advertisement
iNex

Compile source code

Jan 16th, 2012
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 28.65 KB | None | 0 0
  1. //script 1
  2.  
  3. //-----------------------------------
  4. //------------ Include --------------
  5. //-----------------------------------
  6. #include <sourcemod>
  7. #include <autoadmin>
  8. //-----------------------------------
  9. //----------- Var & def -------------
  10. //-----------------------------------
  11. #define EK_Version "0.1B"
  12. #define EK_Creator "iNex"
  13. #define EK_Plugin_Name "Auto-reload"
  14. #define EK_Site ""
  15. #define EK_desc "Recharge le cache admin par rapport au choix de l'admin"
  16.  
  17. //For reload
  18. new Handle:g_round_reload = INVALID_HANDLE;
  19. new Handle:g_spawn_reload = INVALID_HANDLE;
  20. //new Handle:g_map_reload = INVALID_HANDLE;
  21. new Handle:g_auto_reload = INVALID_HANDLE;
  22. new Handle:g_time_reload = INVALID_HANDLE;
  23.  
  24. //-----------------------------------
  25. //----------- Public var ------------
  26. //-----------------------------------
  27.  
  28. public Plugin:myinfo =
  29. {
  30.     name = EK_Plugin_Name,
  31.     author = EK_Creator,
  32.     description = EK_desc,
  33.     version = EK_Version,
  34.     url = EK_Site
  35. };
  36.  
  37. public OnPluginStart()
  38. {
  39.     //Hooking event
  40.     HookEvent("round_start", OnRoundStart, EventHookMode_Post);
  41.     HookEvent("player_spawn", OnPlayerSpawn);
  42.    
  43.     //Create Variable
  44.     CreateConVar("sm_autoreload_version", EK_Version, "Version du plugin", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
  45.     g_round_reload = CreateConVar("sm_round_reload", "1", "Active le rechargement du cache admin a chaque round");
  46.     g_spawn_reload = CreateConVar("sm_spawn_reload", "1", "Active le rechargement du cache admin a spawn de joueur");
  47.     //g_map_reload = CreateConVar("sm_map_reload", "1", "Active le rechargement du cache admin a chaque chargement de map");
  48.     g_auto_reload = CreateConVar("sm_auto_reload", "1", "Active le rechargement du cache admin automatiquement chaque x mn");
  49.     g_time_reload = CreateConVar("sm_time_reload", "20", "Definir le temps avant le rechargement du cache admin");
  50.    
  51.     //For Timer
  52.     CreateTimer(GetConVarFloat(g_time_reload), AutoReload, _, TIMER_REPEAT);
  53.    
  54.     //Lancement de la config
  55.     AutoExecConfig(true, "Auto-reload");
  56. }
  57.  
  58. /*
  59. public OnMapStart()
  60. {
  61.     if (IsReady(g_map_reload))
  62.     {
  63.         DumpAdminCache(AdminCache_Groups, true);
  64.         DumpAdminCache(AdminCache_Overrides, true);
  65.     }
  66. }
  67. */
  68.  
  69. public Action:OnRoundStart(Handle:event,String:name[], bool:dontBroadcast)
  70. {
  71.     if (IsReady(g_round_reload))
  72.     {
  73.         DumpAdminCache(AdminCache_Groups, true);
  74.         DumpAdminCache(AdminCache_Overrides, true);
  75.     }
  76. }
  77.  
  78. public Action:OnPlayerSpawn(Handle:event,String:name[], bool:dontBroadcast)
  79. {
  80.     if (IsReady(g_spawn_reload))
  81.     {
  82.         DumpAdminCache(AdminCache_Groups, true);
  83.         DumpAdminCache(AdminCache_Overrides, true);
  84.     }
  85. }
  86.  
  87. public Action:AutoReload(Handle:timer, any:client)
  88. {
  89.     if (IsReady(g_auto_reload))
  90.     {
  91.         DumpAdminCache(AdminCache_Groups, true);
  92.         DumpAdminCache(AdminCache_Overrides, true);
  93.     }
  94. }
  95. //Script 2
  96.  
  97. //-----------------------------------
  98. //------------ Include --------------
  99. //-----------------------------------
  100.  
  101. #include <smlib>
  102. #include <sourcemod>
  103. #include <clients>
  104. #include <colors>
  105. #include <console>
  106. #include <sdktools>
  107. #include <cstrike>
  108. #include <sdkhooks>
  109.  
  110. //-----------------------------------
  111. //----------- Var & def -------------
  112. //-----------------------------------
  113.  
  114. #pragma semicolon 1
  115. #define EK_Version "0.1B"
  116. #define EK_Creator "iNex"
  117. #define EK_Plugin_Name "Flash Teleport"
  118. #define EK_Site "No url"
  119. #define EK_desc "Teleport entity or client to flash explose, Just for Admin"
  120.  
  121. //-----------------------------------
  122. //----------- Public var ------------
  123. //-----------------------------------
  124.  
  125. public Plugin:myinfo =
  126. {
  127.     name = EK_Plugin_Name,
  128.     author = EK_Creator,
  129.     description = EK_desc,
  130.     version = EK_Version,
  131.     url = EK_Site
  132. };
  133.  
  134. public OnPluginStart()
  135. {
  136.     HookEvent("flashbang_detonate", FlashPorte);
  137.     CreateConVar("sm_FlashPort_version", EK_Version, "Version du plugin", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
  138. }
  139.  
  140.  
  141. public Action:FlashPorte(Handle:event,String:name[], bool:dontBroadcast)
  142. {
  143.         new client = GetClientOfUserId(GetEventInt(event, "userid"));
  144.         new Float:Tel[3];
  145.         GetClientAbsOrigin(client, Tel);      
  146.         Tel[0] = GetEventFloat(event, "x");
  147.         Tel[1] = GetEventFloat(event, "y");
  148.         Tel[2] = GetEventFloat(event, "z");
  149.         if (!IsFakeClient(client) && Client_HasAdminFlags(client, ADMFLAG_SLAY) || Client_HasAdminFlags(client, ADMFLAG_GENERIC) || Client_HasAdminFlags(client, ADMFLAG_ROOT))
  150.         {
  151.             TeleportEntity(client, Tel, NULL_VECTOR, NULL_VECTOR);
  152.         }
  153.         SetEntPropFloat(client, Prop_Send, "m_flFlashDuration", 0);
  154. }
  155.  
  156. //script 3
  157.  
  158. //-----------------------------------
  159. //------------ Include --------------
  160. //-----------------------------------
  161. #include <smlib>
  162. #include <sourcemod>
  163. #include <clients>
  164. #include <colors>
  165. #include <admin>
  166. #include <console>
  167. #include <sdktools>
  168. #include <cstrike>
  169. #include <sdkhooks>
  170. #include <autoadmin>
  171. //-----------------------------------
  172. //----------- Var & def -------------
  173. //-----------------------------------
  174. #define EK_Version "0.1B"
  175. #define EK_Creator "iNex"
  176. #define EK_Plugin_Name "Admin Serveur"
  177. #define EK_Site ""
  178. #define EK_desc "Verification de date site/serveur pour voir si le joueur est vip ou pas"
  179.  
  180. //For Connect to BDD
  181. new Handle:hDatabase = INVALID_HANDLE;
  182.  
  183. //-----------------------------------
  184. //----------- Public var ------------
  185. //-----------------------------------
  186.  
  187. public Plugin:myinfo =
  188. {
  189.     name = EK_Plugin_Name,
  190.     author = EK_Creator,
  191.     description = EK_desc,
  192.     version = EK_Version,
  193.     url = EK_Site
  194. };
  195.  
  196. public OnMapStart()
  197. {
  198.     //Connect Sql
  199.     new String:Error[255];
  200.     hDatabase = SQL_Connect("autoadmin", false, Error, sizeof(Error));
  201.     SQL_Connect("autoadmin", false, Error, sizeof(Error));
  202.     if (hDatabase == INVALID_HANDLE)
  203.     {
  204.         PrintToServer("Failed To Connect To Database: %s", Error);
  205.         LogError("Failed To Connect To Database: %s", Error);
  206.     }
  207.     decl String:TQuery[512];
  208.     /* Director Settings (For identification) */
  209.     Format(TQuery, sizeof(TQuery), "waiting for this");
  210.     SQL_TQuery(hDatabase, QueryCreateTable, TQuery);
  211.     //Disable event
  212.     DisableTeamMessager("player_team");
  213.     //For admin
  214.     if (FindAdmGroup("AutoAdmin") == INVALID_GROUP_ID)
  215.     {
  216.         CreateAdmGroup("AutoAdmin");
  217.     }
  218. }
  219.  
  220. public QueryCreateTable(Handle:owner, Handle:hndl, const String:error[], any:data)
  221. {
  222.     if (hndl!= INVALID_HANDLE)
  223.     {
  224.         PrintToServer("Table crée");
  225.     }
  226.     else
  227.     {
  228.         PrintToServer("Erreur SQL");
  229.     }
  230. }
  231.  
  232. public OnPluginStart()
  233. {
  234.     HookEvent("round_start", OnRoundStart, EventHookMode_Post);
  235.     CreateConVar("sm_autoadmin_version", EK_Version, "Version du plugin", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
  236. }
  237.  
  238. public Action:OnRoundStart(Handle:event,String:name[], bool:dontBroadcast)
  239. {
  240.     new client = GetClientUserId(GetEventInt(event, "userid"));
  241.     if (IsReadyForAdmin(client))
  242.     {
  243.         //Si le joueur n'est pas admin,ou bien est vip on peut le mettre admin
  244.         decl String:time[592];
  245.         FormatTime(time, sizeof(time), "%d/%m/%Y", GetTime());
  246.         new String:Steamid[18];
  247.         new String:query[255];
  248.         GetClientAuthString(client,Steamid,sizeof(Steamid));
  249.         Format(query, sizeof(query), "SELECT * FROM `autoadmin` WHERE steamid='%s' && admin='1'", Steamid);
  250.         new String:fin_time[255];
  251.         new Handle:Query = SQL_Query(hDatabase, query);
  252.         SQL_FetchString(Query, 6,fin_time, sizeof(fin_time));
  253.         new String:debut_time[255];
  254.         SQL_FetchString(Query, 5,debut_time, sizeof(debut_time));
  255.         new String:Pseudo[255];
  256.         GetClientName(client, Pseudo, sizeof(Pseudo));
  257.         if (!StrEqual(time, fin_time, true))
  258.         {
  259.             if (!StrEqual(debut_time, "0", true))
  260.             {
  261.                 if (!StrEqual(time, debut_time, true))
  262.                 {
  263.                     //si valide on ajoute les droits
  264.                     CreateAdmin(Pseudo);
  265.                     DumpAdminCache(AdminCache_Groups, true);
  266.                     DumpAdminCache(AdminCache_Overrides, true);
  267.                     SetAdminFlag(GetUserAdmin(client), Admin_Generic, true);
  268.                     SetAdminFlag(GetUserAdmin(client), Admin_Slay, true);
  269.                     AdminInheritGroup(GetUserAdmin(client), FindAdmGroup("AutoAdmin"));
  270.                     SetAdminFlag(GetUserAdmin(client), Admin_Kick, true);
  271.                     SetAdminFlag(GetUserAdmin(client), Admin_Reservation, true);
  272.                 }
  273.             }
  274.         } else {
  275.             //Si le joueur est en "desacord" avec les donner sql on arrete tout
  276.         }
  277.     } else {
  278.         //Si le joueur est admin alors on arrete tout
  279.     }
  280. }
  281.  
  282. stock DisableTeamMessager(const String:EventName[])
  283. {
  284.     new Handle:newEvent = CreateEvent(EventName, true);
  285.     if (newEvent != INVALID_HANDLE)
  286.     {
  287.         SetEventInt(newEvent, "index", 0);
  288.         SetEventInt(newEvent, "team", 0);
  289.         SetEventInt(newEvent, "oldteam", 0);
  290.         SetEventBool(newEvent, "disconnect", false);
  291.         SetEventBool(newEvent, "autoteam", false);
  292.         SetEventBool(newEvent, "silent", false);
  293.         SetEventString(newEvent, "name", "");
  294.         FireEvent(newEvent);
  295.     }
  296. }
  297.  
  298. //script 4
  299.  
  300. //-----------------------------------
  301. //------------ Include --------------
  302. //-----------------------------------
  303. #include <smlib>
  304. #include <sourcemod>
  305. #include <clients>
  306. #include <colors>
  307. #include <console>
  308. #include <sdktools>
  309. #include <cstrike>
  310. #include <sdkhooks>
  311. //#include <roleplay>
  312. //-----------------------------------
  313. //----------- Var & def -------------
  314. //-----------------------------------
  315. #define EK_Version "0.1B"
  316. #define EK_Creator "iNex"
  317. #define EK_Plugin_Name "Roleplay"
  318. #define EK_Site ""
  319. #define EK_desc ""
  320.  
  321. #define HIDERADAR_VERSION "1.1"
  322.  
  323. new g_Radar;
  324. new g_Bomb;
  325. new g_PlayerManager;
  326.  
  327. //For Connect to BDD
  328. new Handle:hDatabase = INVALID_HANDLE;
  329.  
  330. //Players Show number
  331. new Li_Players;
  332.  
  333.  
  334.  
  335.  
  336. //-----------------------------------
  337. //----------- Public var ------------
  338. //-----------------------------------
  339.  
  340. public Plugin:myinfo =
  341. {
  342.     name = EK_Plugin_Name,
  343.     author = EK_Creator,
  344.     description = EK_desc,
  345.     version = EK_Version,
  346.     url = EK_Site
  347. };
  348.  
  349. public OnMapStart()
  350. {
  351.     ServerCommand("cl_restrict_server_commands 0");
  352.     //Shear Number
  353.     Li_Players = MaxClients;
  354.     //Connect Sql
  355.     new String:Error[255];
  356.     hDatabase = SQL_Connect("roleplay", false, Error, sizeof(Error));
  357.     if (hDatabase == INVALID_HANDLE)
  358.     {
  359.         PrintToServer("Failed To Connect To Database: %s", Error);
  360.         LogError("Failed To Connect To Database: %s", Error);
  361.     }
  362.     decl String:TQuery[512];
  363.     /* Director Settings (For identification) */
  364.     Format(TQuery, sizeof(TQuery), "CREATE TABLE IF NOT EXISTS `roleplay`(id int(11) NOT NULL auto_increment,steamid text NOT NULL,argent_banque int(500) NOT NULL default='0',argent_joueur int(16) NOT NULL default='5000',job_id text NOT NULL default='Sans-emploie', PRIMARY KEY  (id)) TYPE=MyISAM;");
  365.     SQL_TQuery(hDatabase, QueryCreateTable, TQuery);
  366.     //For locking door
  367.     LockingEntity("func_door_rotating");
  368.     LockingEntity("prop_door_rotating");
  369.     LockingEntity("func_door");
  370.     LockingEntity("momentary_rot_button");
  371.     LockingEntity("func_movelinear");
  372.     DisableDeathEvent("player_death", 0);
  373.     DisableTeamMessager("player_team");
  374.     ServerCommand("mp_show_voice_icons 0");
  375. }
  376.  
  377. public OnClientPutInServer(client)
  378. {
  379.     SDKHook(client, SDKHook_PreThink, OnPrePostThink);
  380.     SDKHook(client, SDKHook_Think, OnPrePostThink);
  381.     SDKHook(client, SDKHook_PreThinkPost, OnPrePostThink);
  382.     SDKHook(client, SDKHook_PostThink, OnPrePostThink);
  383.     SDKHook(client, SDKHook_PostThinkPost, OnPrePostThink);
  384. }
  385.  
  386. public OnPrePostThink(client)
  387. {  
  388.     for(new target = 1; target < 65; target++){
  389.         SetEntData(g_PlayerManager, g_Radar + target, 0, 4, true);
  390.     }
  391.     SetEntData(g_PlayerManager, g_Bomb, 0, 4, true);
  392. }
  393.  
  394. public QueryCreateTable(Handle:owner, Handle:hndl, const String:error[], any:data)
  395. {
  396.     if (hndl!= INVALID_HANDLE)
  397.     {
  398.         PrintToServer("Table crée");
  399.     }
  400.     else
  401.     {
  402.         PrintToServer("Erreur SQL");
  403.     }
  404. }
  405.  
  406. public OnPluginStart()
  407. {
  408.     HookEvent("player_spawn", OnSpawn);
  409.     RegAdminCmd("sm_lock", Cmd_Lock, ADMFLAG_CUSTOM6, "For lock a door whit crosshair");
  410.     RegAdminCmd("sm_unlock", Cmd_UnLock, ADMFLAG_CUSTOM6, "For unlock a door whit crosshair");
  411.     RegAdminCmd("sm_tazer", Cmd_Tazer, ADMFLAG_CUSTOM6, "For Freeze a player");
  412.    
  413.     CreateConVar("sm_hideradar_version", HIDERADAR_VERSION, "Hides the radar", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
  414.     CreateConVar("sm_roleplay_version", EK_Version, "Version du roleplay", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
  415.     HookEvent("round_start", Event_OnRoundStart);
  416.     g_Radar = FindSendPropOffs("CCSPlayerResource", "m_bPlayerSpotted");
  417.     if(g_Radar == -1)
  418.         SetFailState("Couldnt find the m_bPlayerSpotted offset!");
  419.    
  420.     g_Bomb = FindSendPropOffs("CCSPlayerResource", "m_bBombSpotted");
  421.     if(g_Bomb == -1)
  422.         SetFailState("Couldnt find the m_bBombSpotted offset!");
  423.     AddCommandListener(SayHook, "say");
  424. }
  425.  
  426. public OnSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  427. {
  428.     new client = GetClientOfUserId(GetEventInt(event, "userid"));
  429.     if (!IsClientInGame(client) || !IsPlayerAlive(client))
  430.     {
  431.         /* rien */
  432.     }
  433.     new pistol = GetPlayerWeaponSlot(client, 1);
  434.     new gun = GetPlayerWeaponSlot(client, 0);
  435.     if (pistol != -1)
  436.     {
  437.         RemovePlayerItem(client, pistol);
  438.         Client_ChangeWeapon(client, "weapon_knife")
  439.         RemoveEdict(pistol);
  440.     }
  441.     if (gun != -1)
  442.     {
  443.         RemovePlayerItem(client, gun);
  444.         Client_ChangeWeapon(client, "weapon_knife")
  445.         RemoveEdict(gun);
  446.     }
  447.     /*
  448.     if (Isjob(client, "%s", p_job) && !GetClientTeam(client) == 0 || !GetClientTeam(client) == 1)
  449.     {
  450.         CS_SetClientClanTag(client, p_job);
  451.     }
  452.     */
  453. }
  454.  
  455. public Action:OnDeath(Handle:event, const String:name[], bool:dontBroadcast)
  456. {
  457.    
  458. }
  459.  
  460. public Action:Cmd_Lock(client, args)
  461. {
  462.     if(!client || !IsClientInGame(client) || !IsPlayerAlive(client))
  463.         return Plugin_Handled;
  464.    
  465.     new iEnt = GetClientAimTarget(client, false);
  466.     decl String:sBuffer[64];
  467.     if(iEnt > 0 && IsValidEntity(iEnt) && GetEntityClassname(iEnt, sBuffer, sizeof(sBuffer)) && (StrEqual(sBuffer, "func_door") || StrEqual(sBuffer, "func_door_rotating") || StrEqual(sBuffer, "momentary_rot_button") || StrEqual(sBuffer, "func_movelinear") || StrEqual(sBuffer, "prop_door_rotating")))
  468.     {
  469.         AcceptEntityInput(iEnt, "Lock", client);
  470.         ReplyToCommand(client, "La porte est maintenant fermer", iEnt);
  471.     }
  472.     else
  473.     {
  474.         ReplyToCommand(client, "Cette porte est déjà fermer.");
  475.     }
  476.    
  477.     return Plugin_Handled;
  478. }
  479. public Action:Cmd_UnLock(client, args)
  480. {
  481.     if(!client || !IsClientInGame(client) || !IsPlayerAlive(client))
  482.         return Plugin_Handled;
  483.    
  484.     new iEnt = GetClientAimTarget(client, false);
  485.     decl String:sBuffer[64];
  486.     if(iEnt > 0
  487.     && IsValidEntity(iEnt)
  488.     && GetEntityClassname(iEnt, sBuffer, sizeof(sBuffer))
  489.     && (StrEqual(sBuffer, "func_door")
  490.     || StrEqual(sBuffer, "func_door_rotating")
  491.     || StrEqual(sBuffer, "prop_door_rotating")
  492.     || StrEqual(sBuffer, "momentary_rot_button")
  493.     || StrEqual(sBuffer, "func_movelinear")))
  494.     {
  495.         AcceptEntityInput(iEnt, "Unlock", client);
  496.         ReplyToCommand(client, "La porte est maintenant ouverte", iEnt);
  497.     }
  498.     else
  499.     {
  500.         ReplyToCommand(client, "Cette porte est déjà ouverte.");
  501.     }
  502.    
  503.     return Plugin_Handled;
  504. }
  505.  
  506. public Action:Cmd_Tazer(client, args)
  507. {
  508.     new aim = GetClientAimTarget(client, true);
  509.     new v_team = GetClientTeam(aim);
  510.     new p_team = GetClientTeam(client);
  511.     new Float:f_victim[3], Float:f_client[3], Float:distance;
  512.     GetEntPropVector(aim, Prop_Send, "m_vecOrigin", f_victim);
  513.     GetEntPropVector(client, Prop_Send, "m_vecOrigin", f_client);
  514.     distance = GetVectorDistance(f_victim, f_client);
  515.     if (distance > 200.0)
  516.     {
  517.         Client_PrintToChat(client, true, "Tu est trop loin pour pouvoir tazer");
  518.     }
  519.     else
  520.     {
  521.         if (aim > 0 && v_team == 2 && p_team == 3 || p_team == 2)
  522.         {
  523.             Client_PrintToChat(client, true, "Tu taze %N", aim);
  524.             SetEntityMoveType(aim, MOVETYPE_NONE);
  525.             CreateTimer(10.0, UnFreeze, aim);
  526.             Client_PrintToChat(aim, true, "Tu a etait taze par %N", client);
  527.         }
  528.     }
  529. }
  530.  
  531. public Action:UnFreeze(Handle:timer, any:aim)
  532. {
  533.     SetEntityMoveType(aim, MOVETYPE_WALK);
  534.     KillTimer(timer, true);
  535. }
  536.  
  537. public Action:Event_OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
  538. {
  539.     g_PlayerManager = FindEntityByClassname(0, "cs_player_manager");
  540.     SDKHook(g_PlayerManager, SDKHook_PreThink, OnPrePostThink);
  541.     SDKHook(g_PlayerManager, SDKHook_Think, OnPrePostThink);
  542.     SDKHook(g_PlayerManager, SDKHook_PreThinkPost, OnPrePostThink);
  543.     SDKHook(g_PlayerManager, SDKHook_PostThink, OnPrePostThink);
  544.     SDKHook(g_PlayerManager, SDKHook_PostThinkPost, OnPrePostThink);
  545. }
  546.  
  547. /*
  548.     For no display a overviewer of killer-weapons-victim in the game.
  549. */
  550. stock DisableDeathEvent(const String:EventName[], value)
  551. {
  552.     new Handle:newEvent = CreateEvent(EventName, true);
  553.     if (newEvent != INVALID_HANDLE)
  554.     {
  555.         new f_client = GetEventInt(newEvent, "attacker");
  556.         new attacker = GetClientUserId(f_client);
  557.         new v_client = GetEventInt(newEvent, "userid");
  558.         new victim = GetClientUserId(v_client);
  559.         Client_SetScore(attacker, value);
  560.         Client_SetScore(victim, value);
  561.         Client_SetDeaths(attacker, value);
  562.         Client_SetDeaths(victim, value);
  563.         SetEventInt(newEvent, "index", value);
  564.         SetEventInt(newEvent, "userid", value);
  565.         SetEventInt(newEvent, "attacker", value);
  566.         SetEventString(newEvent, "weapon", "");
  567.         SetEventBool(newEvent, "headshot", false);
  568.         SetEventInt(newEvent, "dominated", value);
  569.         SetEventInt(newEvent, "revenge", value);
  570.         FireEvent(newEvent);
  571.     }
  572. }
  573. stock DisableTeamMessager(const String:EventName[])
  574. {
  575.     new Handle:newEvent = CreateEvent(EventName, true);
  576.     if (newEvent != INVALID_HANDLE)
  577.     {
  578.         SetEventInt(newEvent, "index", 0);
  579.         SetEventInt(newEvent, "team", 0);
  580.         SetEventInt(newEvent, "oldteam", 0);
  581.         SetEventBool(newEvent, "disconnect", false);
  582.         SetEventBool(newEvent, "autoteam", false);
  583.         SetEventBool(newEvent, "silent", false);
  584.         SetEventString(newEvent, "name", "");
  585.         FireEvent(newEvent);
  586.     }
  587. }
  588. /*
  589.     for Set clantag different par equipe
  590. */
  591. stock GiveClanTag(target, const String:ClanTag[])
  592. {
  593.     if (GetUserAdmin(target) == INVALID_ADMIN_ID && !IsFakeClient(target) && IsClientInGame(target))
  594.     {
  595.         CS_SetClientClanTag(target, ClanTag);
  596.     }
  597. }
  598.  
  599. stock LockingEntity(const String:ClassName[])
  600. {
  601.     new String:entityLock[999];
  602.     for (new i=1; i <= Li_Players; i++)
  603.     {
  604.         if(IsValidEdict(i) && IsValidEntity(i))
  605.         {
  606.             GetEntityClassname(i, entityLock, sizeof(entityLock));
  607.             if(StrEqual(ClassName, entityLock))
  608.             {
  609.                 SetEntProp(i, Prop_Data, "m_bLocked", 1, 1);
  610.                 Entity_AddFlags(i, FL_FROZEN);
  611.                 AcceptEntityInput(i, "Lock");
  612.             }
  613.         }
  614.     }
  615. }  
  616. public Action:SayHook(client, const String:command[], argc)
  617. {
  618.     if(!IsChatTrigger())
  619.     {
  620.         if(client > 0 && GetClientTeam(client) == 2)
  621.         {
  622.             // Get Client's Name
  623.             new String:Name[MAX_NAME_LENGTH];
  624.             GetClientName(client, Name, sizeof(Name));
  625.            
  626.             // Get Client's Chat
  627.             new String:Chat[256];
  628.             GetCmdArgString(Chat, sizeof(Chat));
  629.             StripQuotes(Chat);
  630.            
  631.             CPrintToChatAll("{red}%s{default}: %s", Name, Chat);
  632.            
  633.             return Plugin_Handled;
  634.         }
  635.         if(client > 0 && GetClientTeam(client) == 3)
  636.         {
  637.             // Get Client's Name
  638.             new String:Name[MAX_NAME_LENGTH];
  639.             GetClientName(client, Name, sizeof(Name));
  640.            
  641.             // Get Client's Chat
  642.             new String:Chat[256];
  643.             GetCmdArgString(Chat, sizeof(Chat));
  644.             StripQuotes(Chat);
  645.            
  646.             CPrintToChatAll("{blue}%s{default}: %s", Name, Chat);
  647.            
  648.             return Plugin_Handled;
  649.         }
  650.     }
  651.    
  652.     return Plugin_Continue;
  653. }  
  654.  
  655. //script 5
  656.  
  657. #pragma semicolon 1
  658.  
  659. #include <smlib>
  660. #include <sourcemod>
  661. #include <clients>
  662. #include <colors>
  663. #include <sdktools>
  664. #include <cstrike>
  665. //-----------------------------------                                                                                                                                                                                                                                                                                                                                                                                                                                                    
  666. //----------- Var & def -------------
  667. //-----------------------------------
  668. #define EK_Version "1.0"
  669. #define EK_Creator "iNex"
  670. #define EK_Plugin_Name "information"
  671. #define EK_Site "http://www.infire.com"
  672. #define EK_desc "Crée une liste des joueur en vie"
  673. new Handle:client_timers[MAXPLAYERS+1] = INVALID_HANDLE;
  674. new tueur2;
  675. //-----------------------------------
  676. //----------- Public var ------------
  677. //-----------------------------------
  678. public Plugin:myinfo =
  679. {
  680.     name = EK_Plugin_Name,
  681.     author = EK_Creator,
  682.     description = EK_desc,
  683.     version = EK_Version,
  684.     url = EK_Site
  685. };
  686. public OnPluginStart()
  687. {
  688.     HookEvent("player_spawn", OnSpawn);
  689.     HookEvent("player_death", OnDeath);
  690. }
  691.  
  692. public OnSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  693. {
  694.     new client = GetClientOfUserId(GetEventInt(event, "userid")); // Get client
  695.  
  696.     if(client_timers[client] != INVALID_HANDLE) // Have timer ?
  697.     {
  698.         KillTimer(client_timers[client]); // Kill timer
  699.         client_timers[client] = INVALID_HANDLE; // Clear handle
  700.     }
  701.  
  702.     if(!IsFakeClient(client) && GetClientTeam(client) >= 2) // Not bot and team 2 or 3
  703.     {
  704.         client_timers[client] = CreateTimer(1.0, List_Updater, client, TIMER_REPEAT);
  705.     }
  706. }
  707.  
  708. public Action:List_Updater(Handle:timer, any:client)
  709. {
  710.     if(!IsClientInGame(client) || !IsPlayerAlive(client)) // Check first is player in game, then is it alive
  711.     {
  712.         client_timers[client] = INVALID_HANDLE; // Clear handle
  713.         return Plugin_Stop; //Stop timer
  714.     }
  715.     decl team;
  716.     team = GetClientTeam(client);
  717.     decl String:szText2[254];
  718.     Format(szText2,sizeof(szText2), "Counter-Terroriste a tuer:\n---------------------------\n");
  719.     decl String:szext2[254];
  720.     Format(szext2, sizeof(szext2), "Terroriste a tuer:\n--------------------\n");
  721.         // below I don't uderstand what you want do in this code !! ??
  722.     for(new i = 1; i <= MaxClients; i++)
  723.     {
  724.         if(IsClientInGame(i))
  725.         {
  726.             if(team == 2 && GetClientTeam(i) == 3 && IsPlayerAlive(i))
  727.             {
  728.                 //decl String:L1[254];
  729.                 //Format(L1, sizeof(L1), "Terroriste en Vie:\n%N\n", i);
  730.                 decl String:szText[254];
  731.                 Format(szText, sizeof(szText), "%s%N\n", szText2,i);
  732.                 Client_PrintKeyHintText(client, "%s",szText);
  733.                 decl String:tueur2[255];
  734.                 Format(tueur2, sizeof(tueur2), "%N", i);
  735.                 CPrintToChat(client, "{green}[Rush-Our]{default}Si vous tuer {lightgreen}%N{default}, Vous gagnerez un bonus", i);
  736.             }
  737.             if(team == 3 && GetClientTeam(i) == 2 && IsPlayerAlive(i))
  738.             {
  739.                 //decl String:L1[254];
  740.                 //Format(L1, sizeof(L1), "Counter-Terroriste en vie en Vie:\n%N\n",i);
  741.                 decl String:szext[254];
  742.                 Format(szext, sizeof(szext), "%s%N\n", szext2, i);
  743.                 Client_PrintKeyHintText(client, "%s",szext);
  744.                 decl String:tueur2[255];
  745.                 Format(tueur2, sizeof(tueur2), "%N", i);
  746.                 CPrintToChat(client, "{green}[Rush-Our]{default}Si vous tuer {lightgreen}%N{default}, Vous gagnerez un bonus", i);
  747.             }
  748.         }
  749.     }
  750.     return Plugin_Continue;
  751. }  
  752. public OnDeath(Handle:event, const String:name[], bool:dontBroadcast)
  753. {
  754.     new victim = GetClientOfUserId(GetEventInt(event, "userid"));
  755.     new pro = GetClientOfUserId(GetEventInt(event, "attacker"));
  756.     if (GetClientTeam(victim) == 2)
  757.     {
  758.         if (victim == tueur2)
  759.         {
  760.             SetEntityHealth(pro, 50);
  761.             CPrintToChat(pro, "{green}[Rush-Our]{default}Vous avez Tuer {lightgreen}%N{default}, Vous gagnez donc 50 hp", victim);
  762.         }
  763.     }
  764.     if (GetClientTeam(victim) == 3)
  765.     {
  766.         if (victim == tueur2)
  767.         {
  768.             SetEntityHealth(pro, 50);
  769.             CPrintToChat(pro, "{green}[Rush-Our]{default}Vous avez Tuer {lightgreen}%N{default}, Vous gagnez donc 50 hp", victim);
  770.         }
  771.     }
  772. }
  773.  
  774. //script 6
  775.  
  776. //-----------------------------------
  777. //------------ Include --------------
  778. //-----------------------------------
  779. #include <smlib>
  780. #include <sourcemod>
  781. #include <clients>
  782. #include <colors>
  783. #include <sdktools>
  784. //-----------------------------------
  785. //----------- Var & def -------------
  786. //-----------------------------------
  787. #define EK_Version "1.0"
  788. #define EK_Creator "iNex"
  789. #define EK_Plugin_Name "Serveur and credit info"
  790. #define EK_Site "http://www.infire.com"
  791. #define EK_desc "Donne les informations du serveur plus les regles aux joueurs ainsi que les crédits du joueur"
  792.  
  793. //For Timer
  794. new Handle:client_timers[MAXPLAYERS+1] = INVALID_HANDLE;
  795.  
  796. //For Connect to BDD
  797. new Handle:hDatabase = INVALID_HANDLE;
  798.  
  799. //-----------------------------------
  800. //----------- Public var ------------
  801. //-----------------------------------
  802. public Plugin:myinfo =
  803. {
  804.     name = EK_Plugin_Name,
  805.     author = EK_Creator,
  806.     description = EK_desc,
  807.     version = EK_Version,
  808.     url = EK_Site
  809. };
  810.  
  811. public OnMapStart()
  812. {
  813.     new String:Error[255];
  814.     hDatabase = SQL_Connect("credit", false, Error, sizeof(Error));
  815.     if (hDatabase == INVALID_HANDLE)
  816.     {
  817.         PrintToServer("Failed To Connect To Database: %s", Error);
  818.         LogError("Failed To Connect To Database: %s", Error);
  819.     }
  820.     decl String:TQuery[512];
  821.     /* Director Settings (For identification) */
  822.     Format(TQuery, sizeof(TQuery), "CREATE TABLE IF NOT EXISTS `users` (id int(11) NOT NULL auto_increment,steamid text NOT NULL,credit text NOT NULL,PRIMARY KEY  (id)) TYPE=MyISAM;");
  823.     SQL_TQuery(hDatabase, QueryCreateTable, TQuery);
  824. }
  825.  
  826. public QueryCreateTable(Handle:owner, Handle:hndl, const String:error[], any:data)
  827. {
  828.     if (hndl!= INVALID_HANDLE)
  829.     {
  830.         PrintToServer("Table crée");
  831.     }
  832. }
  833.  
  834. public OnPluginStart()
  835. {
  836.     HookEvent("player_spawn", OnSpawn, EventHookMode_Post);
  837.     HookEvent("player_team", OnPlayerTeam, EventHookMode_Pre);
  838. }
  839.  
  840. public OnSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  841. {
  842.     new client = GetClientOfUserId(GetEventInt(event, "userid"));
  843.     if(client_timers[client] != INVALID_HANDLE) // Have timer ?
  844.     {
  845.         KillTimer(client_timers[client]); // Kill timer
  846.         client_timers[client] = INVALID_HANDLE; // Clear handle
  847.     }
  848.  
  849.     if(!IsFakeClient(client)) // Not bot and team 2 or 3
  850.     {
  851.         client_timers[client] = CreateTimer(1.0, Ms_Updater, client, TIMER_REPEAT);
  852.     }
  853. }
  854.  
  855. public Action:Ms_Updater(Handle:timer, any:client)
  856. {
  857.     if(!IsClientInGame(client) || !IsPlayerAlive(client)) // Check first is player in game, then is it alive
  858.     {
  859.         client_timers[client] = INVALID_HANDLE; // Clear handle
  860.         return Plugin_Stop; //Stop timer
  861.     }
  862.     new String:SteamID[38];
  863.     GetClientAuthString(client,SteamID,sizeof(SteamID));
  864.     new String:select[999];
  865.     Format(select, sizeof(select),"SELECT credit FROM `users` WHERE steamid='%s'", SteamID);
  866.     new Handle:Select = SQL_Query(hDatabase, select);
  867.     if(Select != INVALID_HANDLE)
  868.     {
  869.         if(SQL_FetchRow(Select))
  870.         {
  871.             new credit = SQL_FetchInt(Select, 0);
  872.             Client_PrintKeyHintText(client, "--------------------------\n iNex Server \n--------------------------\nPlugin unique\nNo camp \n--------------------------\nVos crédit: %d\nServeur Config par iNex\n--------------------------\nMenu par iNex \n---------------------------", credit);
  873.         }
  874.         CloseHandle(Select);
  875.     }
  876.    
  877.     return Plugin_Continue;
  878. }  
  879. public Action:OnPlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
  880. {
  881.     return Plugin_Handled;
  882. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement