Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //script 1
- //-----------------------------------
- //------------ Include --------------
- //-----------------------------------
- #include <sourcemod>
- #include <autoadmin>
- //-----------------------------------
- //----------- Var & def -------------
- //-----------------------------------
- #define EK_Version "0.1B"
- #define EK_Creator "iNex"
- #define EK_Plugin_Name "Auto-reload"
- #define EK_Site ""
- #define EK_desc "Recharge le cache admin par rapport au choix de l'admin"
- //For reload
- new Handle:g_round_reload = INVALID_HANDLE;
- new Handle:g_spawn_reload = INVALID_HANDLE;
- //new Handle:g_map_reload = INVALID_HANDLE;
- new Handle:g_auto_reload = INVALID_HANDLE;
- new Handle:g_time_reload = INVALID_HANDLE;
- //-----------------------------------
- //----------- Public var ------------
- //-----------------------------------
- public Plugin:myinfo =
- {
- name = EK_Plugin_Name,
- author = EK_Creator,
- description = EK_desc,
- version = EK_Version,
- url = EK_Site
- };
- public OnPluginStart()
- {
- //Hooking event
- HookEvent("round_start", OnRoundStart, EventHookMode_Post);
- HookEvent("player_spawn", OnPlayerSpawn);
- //Create Variable
- CreateConVar("sm_autoreload_version", EK_Version, "Version du plugin", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
- g_round_reload = CreateConVar("sm_round_reload", "1", "Active le rechargement du cache admin a chaque round");
- g_spawn_reload = CreateConVar("sm_spawn_reload", "1", "Active le rechargement du cache admin a spawn de joueur");
- //g_map_reload = CreateConVar("sm_map_reload", "1", "Active le rechargement du cache admin a chaque chargement de map");
- g_auto_reload = CreateConVar("sm_auto_reload", "1", "Active le rechargement du cache admin automatiquement chaque x mn");
- g_time_reload = CreateConVar("sm_time_reload", "20", "Definir le temps avant le rechargement du cache admin");
- //For Timer
- CreateTimer(GetConVarFloat(g_time_reload), AutoReload, _, TIMER_REPEAT);
- //Lancement de la config
- AutoExecConfig(true, "Auto-reload");
- }
- /*
- public OnMapStart()
- {
- if (IsReady(g_map_reload))
- {
- DumpAdminCache(AdminCache_Groups, true);
- DumpAdminCache(AdminCache_Overrides, true);
- }
- }
- */
- public Action:OnRoundStart(Handle:event,String:name[], bool:dontBroadcast)
- {
- if (IsReady(g_round_reload))
- {
- DumpAdminCache(AdminCache_Groups, true);
- DumpAdminCache(AdminCache_Overrides, true);
- }
- }
- public Action:OnPlayerSpawn(Handle:event,String:name[], bool:dontBroadcast)
- {
- if (IsReady(g_spawn_reload))
- {
- DumpAdminCache(AdminCache_Groups, true);
- DumpAdminCache(AdminCache_Overrides, true);
- }
- }
- public Action:AutoReload(Handle:timer, any:client)
- {
- if (IsReady(g_auto_reload))
- {
- DumpAdminCache(AdminCache_Groups, true);
- DumpAdminCache(AdminCache_Overrides, true);
- }
- }
- //Script 2
- //-----------------------------------
- //------------ Include --------------
- //-----------------------------------
- #include <smlib>
- #include <sourcemod>
- #include <clients>
- #include <colors>
- #include <console>
- #include <sdktools>
- #include <cstrike>
- #include <sdkhooks>
- //-----------------------------------
- //----------- Var & def -------------
- //-----------------------------------
- #pragma semicolon 1
- #define EK_Version "0.1B"
- #define EK_Creator "iNex"
- #define EK_Plugin_Name "Flash Teleport"
- #define EK_Site "No url"
- #define EK_desc "Teleport entity or client to flash explose, Just for Admin"
- //-----------------------------------
- //----------- Public var ------------
- //-----------------------------------
- public Plugin:myinfo =
- {
- name = EK_Plugin_Name,
- author = EK_Creator,
- description = EK_desc,
- version = EK_Version,
- url = EK_Site
- };
- public OnPluginStart()
- {
- HookEvent("flashbang_detonate", FlashPorte);
- CreateConVar("sm_FlashPort_version", EK_Version, "Version du plugin", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
- }
- public Action:FlashPorte(Handle:event,String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- new Float:Tel[3];
- GetClientAbsOrigin(client, Tel);
- Tel[0] = GetEventFloat(event, "x");
- Tel[1] = GetEventFloat(event, "y");
- Tel[2] = GetEventFloat(event, "z");
- if (!IsFakeClient(client) && Client_HasAdminFlags(client, ADMFLAG_SLAY) || Client_HasAdminFlags(client, ADMFLAG_GENERIC) || Client_HasAdminFlags(client, ADMFLAG_ROOT))
- {
- TeleportEntity(client, Tel, NULL_VECTOR, NULL_VECTOR);
- }
- SetEntPropFloat(client, Prop_Send, "m_flFlashDuration", 0);
- }
- //script 3
- //-----------------------------------
- //------------ Include --------------
- //-----------------------------------
- #include <smlib>
- #include <sourcemod>
- #include <clients>
- #include <colors>
- #include <admin>
- #include <console>
- #include <sdktools>
- #include <cstrike>
- #include <sdkhooks>
- #include <autoadmin>
- //-----------------------------------
- //----------- Var & def -------------
- //-----------------------------------
- #define EK_Version "0.1B"
- #define EK_Creator "iNex"
- #define EK_Plugin_Name "Admin Serveur"
- #define EK_Site ""
- #define EK_desc "Verification de date site/serveur pour voir si le joueur est vip ou pas"
- //For Connect to BDD
- new Handle:hDatabase = INVALID_HANDLE;
- //-----------------------------------
- //----------- Public var ------------
- //-----------------------------------
- public Plugin:myinfo =
- {
- name = EK_Plugin_Name,
- author = EK_Creator,
- description = EK_desc,
- version = EK_Version,
- url = EK_Site
- };
- public OnMapStart()
- {
- //Connect Sql
- new String:Error[255];
- hDatabase = SQL_Connect("autoadmin", false, Error, sizeof(Error));
- SQL_Connect("autoadmin", false, Error, sizeof(Error));
- if (hDatabase == INVALID_HANDLE)
- {
- PrintToServer("Failed To Connect To Database: %s", Error);
- LogError("Failed To Connect To Database: %s", Error);
- }
- decl String:TQuery[512];
- /* Director Settings (For identification) */
- Format(TQuery, sizeof(TQuery), "waiting for this");
- SQL_TQuery(hDatabase, QueryCreateTable, TQuery);
- //Disable event
- DisableTeamMessager("player_team");
- //For admin
- if (FindAdmGroup("AutoAdmin") == INVALID_GROUP_ID)
- {
- CreateAdmGroup("AutoAdmin");
- }
- }
- public QueryCreateTable(Handle:owner, Handle:hndl, const String:error[], any:data)
- {
- if (hndl!= INVALID_HANDLE)
- {
- PrintToServer("Table crée");
- }
- else
- {
- PrintToServer("Erreur SQL");
- }
- }
- public OnPluginStart()
- {
- HookEvent("round_start", OnRoundStart, EventHookMode_Post);
- CreateConVar("sm_autoadmin_version", EK_Version, "Version du plugin", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
- }
- public Action:OnRoundStart(Handle:event,String:name[], bool:dontBroadcast)
- {
- new client = GetClientUserId(GetEventInt(event, "userid"));
- if (IsReadyForAdmin(client))
- {
- //Si le joueur n'est pas admin,ou bien est vip on peut le mettre admin
- decl String:time[592];
- FormatTime(time, sizeof(time), "%d/%m/%Y", GetTime());
- new String:Steamid[18];
- new String:query[255];
- GetClientAuthString(client,Steamid,sizeof(Steamid));
- Format(query, sizeof(query), "SELECT * FROM `autoadmin` WHERE steamid='%s' && admin='1'", Steamid);
- new String:fin_time[255];
- new Handle:Query = SQL_Query(hDatabase, query);
- SQL_FetchString(Query, 6,fin_time, sizeof(fin_time));
- new String:debut_time[255];
- SQL_FetchString(Query, 5,debut_time, sizeof(debut_time));
- new String:Pseudo[255];
- GetClientName(client, Pseudo, sizeof(Pseudo));
- if (!StrEqual(time, fin_time, true))
- {
- if (!StrEqual(debut_time, "0", true))
- {
- if (!StrEqual(time, debut_time, true))
- {
- //si valide on ajoute les droits
- CreateAdmin(Pseudo);
- DumpAdminCache(AdminCache_Groups, true);
- DumpAdminCache(AdminCache_Overrides, true);
- SetAdminFlag(GetUserAdmin(client), Admin_Generic, true);
- SetAdminFlag(GetUserAdmin(client), Admin_Slay, true);
- AdminInheritGroup(GetUserAdmin(client), FindAdmGroup("AutoAdmin"));
- SetAdminFlag(GetUserAdmin(client), Admin_Kick, true);
- SetAdminFlag(GetUserAdmin(client), Admin_Reservation, true);
- }
- }
- } else {
- //Si le joueur est en "desacord" avec les donner sql on arrete tout
- }
- } else {
- //Si le joueur est admin alors on arrete tout
- }
- }
- stock DisableTeamMessager(const String:EventName[])
- {
- new Handle:newEvent = CreateEvent(EventName, true);
- if (newEvent != INVALID_HANDLE)
- {
- SetEventInt(newEvent, "index", 0);
- SetEventInt(newEvent, "team", 0);
- SetEventInt(newEvent, "oldteam", 0);
- SetEventBool(newEvent, "disconnect", false);
- SetEventBool(newEvent, "autoteam", false);
- SetEventBool(newEvent, "silent", false);
- SetEventString(newEvent, "name", "");
- FireEvent(newEvent);
- }
- }
- //script 4
- //-----------------------------------
- //------------ Include --------------
- //-----------------------------------
- #include <smlib>
- #include <sourcemod>
- #include <clients>
- #include <colors>
- #include <console>
- #include <sdktools>
- #include <cstrike>
- #include <sdkhooks>
- //#include <roleplay>
- //-----------------------------------
- //----------- Var & def -------------
- //-----------------------------------
- #define EK_Version "0.1B"
- #define EK_Creator "iNex"
- #define EK_Plugin_Name "Roleplay"
- #define EK_Site ""
- #define EK_desc ""
- #define HIDERADAR_VERSION "1.1"
- new g_Radar;
- new g_Bomb;
- new g_PlayerManager;
- //For Connect to BDD
- new Handle:hDatabase = INVALID_HANDLE;
- //Players Show number
- new Li_Players;
- //-----------------------------------
- //----------- Public var ------------
- //-----------------------------------
- public Plugin:myinfo =
- {
- name = EK_Plugin_Name,
- author = EK_Creator,
- description = EK_desc,
- version = EK_Version,
- url = EK_Site
- };
- public OnMapStart()
- {
- ServerCommand("cl_restrict_server_commands 0");
- //Shear Number
- Li_Players = MaxClients;
- //Connect Sql
- new String:Error[255];
- hDatabase = SQL_Connect("roleplay", false, Error, sizeof(Error));
- if (hDatabase == INVALID_HANDLE)
- {
- PrintToServer("Failed To Connect To Database: %s", Error);
- LogError("Failed To Connect To Database: %s", Error);
- }
- decl String:TQuery[512];
- /* Director Settings (For identification) */
- 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;");
- SQL_TQuery(hDatabase, QueryCreateTable, TQuery);
- //For locking door
- LockingEntity("func_door_rotating");
- LockingEntity("prop_door_rotating");
- LockingEntity("func_door");
- LockingEntity("momentary_rot_button");
- LockingEntity("func_movelinear");
- DisableDeathEvent("player_death", 0);
- DisableTeamMessager("player_team");
- ServerCommand("mp_show_voice_icons 0");
- }
- public OnClientPutInServer(client)
- {
- SDKHook(client, SDKHook_PreThink, OnPrePostThink);
- SDKHook(client, SDKHook_Think, OnPrePostThink);
- SDKHook(client, SDKHook_PreThinkPost, OnPrePostThink);
- SDKHook(client, SDKHook_PostThink, OnPrePostThink);
- SDKHook(client, SDKHook_PostThinkPost, OnPrePostThink);
- }
- public OnPrePostThink(client)
- {
- for(new target = 1; target < 65; target++){
- SetEntData(g_PlayerManager, g_Radar + target, 0, 4, true);
- }
- SetEntData(g_PlayerManager, g_Bomb, 0, 4, true);
- }
- public QueryCreateTable(Handle:owner, Handle:hndl, const String:error[], any:data)
- {
- if (hndl!= INVALID_HANDLE)
- {
- PrintToServer("Table crée");
- }
- else
- {
- PrintToServer("Erreur SQL");
- }
- }
- public OnPluginStart()
- {
- HookEvent("player_spawn", OnSpawn);
- RegAdminCmd("sm_lock", Cmd_Lock, ADMFLAG_CUSTOM6, "For lock a door whit crosshair");
- RegAdminCmd("sm_unlock", Cmd_UnLock, ADMFLAG_CUSTOM6, "For unlock a door whit crosshair");
- RegAdminCmd("sm_tazer", Cmd_Tazer, ADMFLAG_CUSTOM6, "For Freeze a player");
- CreateConVar("sm_hideradar_version", HIDERADAR_VERSION, "Hides the radar", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
- CreateConVar("sm_roleplay_version", EK_Version, "Version du roleplay", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
- HookEvent("round_start", Event_OnRoundStart);
- g_Radar = FindSendPropOffs("CCSPlayerResource", "m_bPlayerSpotted");
- if(g_Radar == -1)
- SetFailState("Couldnt find the m_bPlayerSpotted offset!");
- g_Bomb = FindSendPropOffs("CCSPlayerResource", "m_bBombSpotted");
- if(g_Bomb == -1)
- SetFailState("Couldnt find the m_bBombSpotted offset!");
- AddCommandListener(SayHook, "say");
- }
- public OnSpawn(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- if (!IsClientInGame(client) || !IsPlayerAlive(client))
- {
- /* rien */
- }
- new pistol = GetPlayerWeaponSlot(client, 1);
- new gun = GetPlayerWeaponSlot(client, 0);
- if (pistol != -1)
- {
- RemovePlayerItem(client, pistol);
- Client_ChangeWeapon(client, "weapon_knife")
- RemoveEdict(pistol);
- }
- if (gun != -1)
- {
- RemovePlayerItem(client, gun);
- Client_ChangeWeapon(client, "weapon_knife")
- RemoveEdict(gun);
- }
- /*
- if (Isjob(client, "%s", p_job) && !GetClientTeam(client) == 0 || !GetClientTeam(client) == 1)
- {
- CS_SetClientClanTag(client, p_job);
- }
- */
- }
- public Action:OnDeath(Handle:event, const String:name[], bool:dontBroadcast)
- {
- }
- public Action:Cmd_Lock(client, args)
- {
- if(!client || !IsClientInGame(client) || !IsPlayerAlive(client))
- return Plugin_Handled;
- new iEnt = GetClientAimTarget(client, false);
- decl String:sBuffer[64];
- 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")))
- {
- AcceptEntityInput(iEnt, "Lock", client);
- ReplyToCommand(client, "La porte est maintenant fermer", iEnt);
- }
- else
- {
- ReplyToCommand(client, "Cette porte est déjà fermer.");
- }
- return Plugin_Handled;
- }
- public Action:Cmd_UnLock(client, args)
- {
- if(!client || !IsClientInGame(client) || !IsPlayerAlive(client))
- return Plugin_Handled;
- new iEnt = GetClientAimTarget(client, false);
- decl String:sBuffer[64];
- if(iEnt > 0
- && IsValidEntity(iEnt)
- && GetEntityClassname(iEnt, sBuffer, sizeof(sBuffer))
- && (StrEqual(sBuffer, "func_door")
- || StrEqual(sBuffer, "func_door_rotating")
- || StrEqual(sBuffer, "prop_door_rotating")
- || StrEqual(sBuffer, "momentary_rot_button")
- || StrEqual(sBuffer, "func_movelinear")))
- {
- AcceptEntityInput(iEnt, "Unlock", client);
- ReplyToCommand(client, "La porte est maintenant ouverte", iEnt);
- }
- else
- {
- ReplyToCommand(client, "Cette porte est déjà ouverte.");
- }
- return Plugin_Handled;
- }
- public Action:Cmd_Tazer(client, args)
- {
- new aim = GetClientAimTarget(client, true);
- new v_team = GetClientTeam(aim);
- new p_team = GetClientTeam(client);
- new Float:f_victim[3], Float:f_client[3], Float:distance;
- GetEntPropVector(aim, Prop_Send, "m_vecOrigin", f_victim);
- GetEntPropVector(client, Prop_Send, "m_vecOrigin", f_client);
- distance = GetVectorDistance(f_victim, f_client);
- if (distance > 200.0)
- {
- Client_PrintToChat(client, true, "Tu est trop loin pour pouvoir tazer");
- }
- else
- {
- if (aim > 0 && v_team == 2 && p_team == 3 || p_team == 2)
- {
- Client_PrintToChat(client, true, "Tu taze %N", aim);
- SetEntityMoveType(aim, MOVETYPE_NONE);
- CreateTimer(10.0, UnFreeze, aim);
- Client_PrintToChat(aim, true, "Tu a etait taze par %N", client);
- }
- }
- }
- public Action:UnFreeze(Handle:timer, any:aim)
- {
- SetEntityMoveType(aim, MOVETYPE_WALK);
- KillTimer(timer, true);
- }
- public Action:Event_OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
- {
- g_PlayerManager = FindEntityByClassname(0, "cs_player_manager");
- SDKHook(g_PlayerManager, SDKHook_PreThink, OnPrePostThink);
- SDKHook(g_PlayerManager, SDKHook_Think, OnPrePostThink);
- SDKHook(g_PlayerManager, SDKHook_PreThinkPost, OnPrePostThink);
- SDKHook(g_PlayerManager, SDKHook_PostThink, OnPrePostThink);
- SDKHook(g_PlayerManager, SDKHook_PostThinkPost, OnPrePostThink);
- }
- /*
- For no display a overviewer of killer-weapons-victim in the game.
- */
- stock DisableDeathEvent(const String:EventName[], value)
- {
- new Handle:newEvent = CreateEvent(EventName, true);
- if (newEvent != INVALID_HANDLE)
- {
- new f_client = GetEventInt(newEvent, "attacker");
- new attacker = GetClientUserId(f_client);
- new v_client = GetEventInt(newEvent, "userid");
- new victim = GetClientUserId(v_client);
- Client_SetScore(attacker, value);
- Client_SetScore(victim, value);
- Client_SetDeaths(attacker, value);
- Client_SetDeaths(victim, value);
- SetEventInt(newEvent, "index", value);
- SetEventInt(newEvent, "userid", value);
- SetEventInt(newEvent, "attacker", value);
- SetEventString(newEvent, "weapon", "");
- SetEventBool(newEvent, "headshot", false);
- SetEventInt(newEvent, "dominated", value);
- SetEventInt(newEvent, "revenge", value);
- FireEvent(newEvent);
- }
- }
- stock DisableTeamMessager(const String:EventName[])
- {
- new Handle:newEvent = CreateEvent(EventName, true);
- if (newEvent != INVALID_HANDLE)
- {
- SetEventInt(newEvent, "index", 0);
- SetEventInt(newEvent, "team", 0);
- SetEventInt(newEvent, "oldteam", 0);
- SetEventBool(newEvent, "disconnect", false);
- SetEventBool(newEvent, "autoteam", false);
- SetEventBool(newEvent, "silent", false);
- SetEventString(newEvent, "name", "");
- FireEvent(newEvent);
- }
- }
- /*
- for Set clantag different par equipe
- */
- stock GiveClanTag(target, const String:ClanTag[])
- {
- if (GetUserAdmin(target) == INVALID_ADMIN_ID && !IsFakeClient(target) && IsClientInGame(target))
- {
- CS_SetClientClanTag(target, ClanTag);
- }
- }
- stock LockingEntity(const String:ClassName[])
- {
- new String:entityLock[999];
- for (new i=1; i <= Li_Players; i++)
- {
- if(IsValidEdict(i) && IsValidEntity(i))
- {
- GetEntityClassname(i, entityLock, sizeof(entityLock));
- if(StrEqual(ClassName, entityLock))
- {
- SetEntProp(i, Prop_Data, "m_bLocked", 1, 1);
- Entity_AddFlags(i, FL_FROZEN);
- AcceptEntityInput(i, "Lock");
- }
- }
- }
- }
- public Action:SayHook(client, const String:command[], argc)
- {
- if(!IsChatTrigger())
- {
- if(client > 0 && GetClientTeam(client) == 2)
- {
- // Get Client's Name
- new String:Name[MAX_NAME_LENGTH];
- GetClientName(client, Name, sizeof(Name));
- // Get Client's Chat
- new String:Chat[256];
- GetCmdArgString(Chat, sizeof(Chat));
- StripQuotes(Chat);
- CPrintToChatAll("{red}%s{default}: %s", Name, Chat);
- return Plugin_Handled;
- }
- if(client > 0 && GetClientTeam(client) == 3)
- {
- // Get Client's Name
- new String:Name[MAX_NAME_LENGTH];
- GetClientName(client, Name, sizeof(Name));
- // Get Client's Chat
- new String:Chat[256];
- GetCmdArgString(Chat, sizeof(Chat));
- StripQuotes(Chat);
- CPrintToChatAll("{blue}%s{default}: %s", Name, Chat);
- return Plugin_Handled;
- }
- }
- return Plugin_Continue;
- }
- //script 5
- #pragma semicolon 1
- #include <smlib>
- #include <sourcemod>
- #include <clients>
- #include <colors>
- #include <sdktools>
- #include <cstrike>
- //-----------------------------------
- //----------- Var & def -------------
- //-----------------------------------
- #define EK_Version "1.0"
- #define EK_Creator "iNex"
- #define EK_Plugin_Name "information"
- #define EK_Site "http://www.infire.com"
- #define EK_desc "Crée une liste des joueur en vie"
- new Handle:client_timers[MAXPLAYERS+1] = INVALID_HANDLE;
- new tueur2;
- //-----------------------------------
- //----------- Public var ------------
- //-----------------------------------
- public Plugin:myinfo =
- {
- name = EK_Plugin_Name,
- author = EK_Creator,
- description = EK_desc,
- version = EK_Version,
- url = EK_Site
- };
- public OnPluginStart()
- {
- HookEvent("player_spawn", OnSpawn);
- HookEvent("player_death", OnDeath);
- }
- public OnSpawn(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid")); // Get client
- if(client_timers[client] != INVALID_HANDLE) // Have timer ?
- {
- KillTimer(client_timers[client]); // Kill timer
- client_timers[client] = INVALID_HANDLE; // Clear handle
- }
- if(!IsFakeClient(client) && GetClientTeam(client) >= 2) // Not bot and team 2 or 3
- {
- client_timers[client] = CreateTimer(1.0, List_Updater, client, TIMER_REPEAT);
- }
- }
- public Action:List_Updater(Handle:timer, any:client)
- {
- if(!IsClientInGame(client) || !IsPlayerAlive(client)) // Check first is player in game, then is it alive
- {
- client_timers[client] = INVALID_HANDLE; // Clear handle
- return Plugin_Stop; //Stop timer
- }
- decl team;
- team = GetClientTeam(client);
- decl String:szText2[254];
- Format(szText2,sizeof(szText2), "Counter-Terroriste a tuer:\n---------------------------\n");
- decl String:szext2[254];
- Format(szext2, sizeof(szext2), "Terroriste a tuer:\n--------------------\n");
- // below I don't uderstand what you want do in this code !! ??
- for(new i = 1; i <= MaxClients; i++)
- {
- if(IsClientInGame(i))
- {
- if(team == 2 && GetClientTeam(i) == 3 && IsPlayerAlive(i))
- {
- //decl String:L1[254];
- //Format(L1, sizeof(L1), "Terroriste en Vie:\n%N\n", i);
- decl String:szText[254];
- Format(szText, sizeof(szText), "%s%N\n", szText2,i);
- Client_PrintKeyHintText(client, "%s",szText);
- decl String:tueur2[255];
- Format(tueur2, sizeof(tueur2), "%N", i);
- CPrintToChat(client, "{green}[Rush-Our]{default}Si vous tuer {lightgreen}%N{default}, Vous gagnerez un bonus", i);
- }
- if(team == 3 && GetClientTeam(i) == 2 && IsPlayerAlive(i))
- {
- //decl String:L1[254];
- //Format(L1, sizeof(L1), "Counter-Terroriste en vie en Vie:\n%N\n",i);
- decl String:szext[254];
- Format(szext, sizeof(szext), "%s%N\n", szext2, i);
- Client_PrintKeyHintText(client, "%s",szext);
- decl String:tueur2[255];
- Format(tueur2, sizeof(tueur2), "%N", i);
- CPrintToChat(client, "{green}[Rush-Our]{default}Si vous tuer {lightgreen}%N{default}, Vous gagnerez un bonus", i);
- }
- }
- }
- return Plugin_Continue;
- }
- public OnDeath(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new victim = GetClientOfUserId(GetEventInt(event, "userid"));
- new pro = GetClientOfUserId(GetEventInt(event, "attacker"));
- if (GetClientTeam(victim) == 2)
- {
- if (victim == tueur2)
- {
- SetEntityHealth(pro, 50);
- CPrintToChat(pro, "{green}[Rush-Our]{default}Vous avez Tuer {lightgreen}%N{default}, Vous gagnez donc 50 hp", victim);
- }
- }
- if (GetClientTeam(victim) == 3)
- {
- if (victim == tueur2)
- {
- SetEntityHealth(pro, 50);
- CPrintToChat(pro, "{green}[Rush-Our]{default}Vous avez Tuer {lightgreen}%N{default}, Vous gagnez donc 50 hp", victim);
- }
- }
- }
- //script 6
- //-----------------------------------
- //------------ Include --------------
- //-----------------------------------
- #include <smlib>
- #include <sourcemod>
- #include <clients>
- #include <colors>
- #include <sdktools>
- //-----------------------------------
- //----------- Var & def -------------
- //-----------------------------------
- #define EK_Version "1.0"
- #define EK_Creator "iNex"
- #define EK_Plugin_Name "Serveur and credit info"
- #define EK_Site "http://www.infire.com"
- #define EK_desc "Donne les informations du serveur plus les regles aux joueurs ainsi que les crédits du joueur"
- //For Timer
- new Handle:client_timers[MAXPLAYERS+1] = INVALID_HANDLE;
- //For Connect to BDD
- new Handle:hDatabase = INVALID_HANDLE;
- //-----------------------------------
- //----------- Public var ------------
- //-----------------------------------
- public Plugin:myinfo =
- {
- name = EK_Plugin_Name,
- author = EK_Creator,
- description = EK_desc,
- version = EK_Version,
- url = EK_Site
- };
- public OnMapStart()
- {
- new String:Error[255];
- hDatabase = SQL_Connect("credit", false, Error, sizeof(Error));
- if (hDatabase == INVALID_HANDLE)
- {
- PrintToServer("Failed To Connect To Database: %s", Error);
- LogError("Failed To Connect To Database: %s", Error);
- }
- decl String:TQuery[512];
- /* Director Settings (For identification) */
- 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;");
- SQL_TQuery(hDatabase, QueryCreateTable, TQuery);
- }
- public QueryCreateTable(Handle:owner, Handle:hndl, const String:error[], any:data)
- {
- if (hndl!= INVALID_HANDLE)
- {
- PrintToServer("Table crée");
- }
- }
- public OnPluginStart()
- {
- HookEvent("player_spawn", OnSpawn, EventHookMode_Post);
- HookEvent("player_team", OnPlayerTeam, EventHookMode_Pre);
- }
- public OnSpawn(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- if(client_timers[client] != INVALID_HANDLE) // Have timer ?
- {
- KillTimer(client_timers[client]); // Kill timer
- client_timers[client] = INVALID_HANDLE; // Clear handle
- }
- if(!IsFakeClient(client)) // Not bot and team 2 or 3
- {
- client_timers[client] = CreateTimer(1.0, Ms_Updater, client, TIMER_REPEAT);
- }
- }
- public Action:Ms_Updater(Handle:timer, any:client)
- {
- if(!IsClientInGame(client) || !IsPlayerAlive(client)) // Check first is player in game, then is it alive
- {
- client_timers[client] = INVALID_HANDLE; // Clear handle
- return Plugin_Stop; //Stop timer
- }
- new String:SteamID[38];
- GetClientAuthString(client,SteamID,sizeof(SteamID));
- new String:select[999];
- Format(select, sizeof(select),"SELECT credit FROM `users` WHERE steamid='%s'", SteamID);
- new Handle:Select = SQL_Query(hDatabase, select);
- if(Select != INVALID_HANDLE)
- {
- if(SQL_FetchRow(Select))
- {
- new credit = SQL_FetchInt(Select, 0);
- 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);
- }
- CloseHandle(Select);
- }
- return Plugin_Continue;
- }
- public Action:OnPlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
- {
- return Plugin_Handled;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement