| Дата: Суббота, 10.12.2011, 17:21 | Сообщение # 6 |
| Ага, я на ES выложил) На SM форуме лень было регаться... кстати, вот исходник:
Code #include <sourcemod> #include <sdktools> #include <cstrike> #include <colors> #include <clientprefs>
#pragma semicolon 1
#define PLUGIN_VERSION "1.0.000" #define msg "{green}[Invisible Mod] %t" #define msg2 "{green}[Invisible Mod] %t %t" new tpt; new player_tD; new TeamRand_weapon; new fff; new ti; new xd;
public Plugin:myinfo = { name = "Invisible Mod", author = "Str1k3r (Real-Gamer.RU)", description = "Invisible Mod for Counter-Strike Source.", version = PLUGIN_VERSION, url = "http://real-gamer.ru" }
public OnPluginStart() { LoadTranslations("plugin.invisible"); RegConsoleCmd("jointeam", cmd_jointeam); RegConsoleCmd("joinclass", cmd_suicide); RegConsoleCmd("spectate", cmd_spectate); RegConsoleCmd("kill", cmd_suicide); RegConsoleCmd("explode", cmd_suicide); HookEvent("round_end", Event_RoundEndX); HookEvent("item_pickup", Event_ItemPickup); HookEvent("player_spawn", Event_OnPlayerSpawn); HookEvent("player_death", Event_PlayerDeath); HookEvent("player_hurt", Event_PlayerHurt); HookEvent("player_disconnect", PlayerDisconnect_Event, EventHookMode_Pre); ServerCommand("mp_round_restart_delay 5.0"); ServerCommand("mp_forcecamera 0"); ServerCommand("mp_limitteams 0"); ServerCommand("sv_gravity 700"); ServerCommand("mp_autoteambalance 0"); }
public OnMapStart() { new ent = CreateEntityByName("func_hostage_rescue"); if (ent > 0) { new Float:orign[3] = {-1000.0,...}; DispatchKeyValue(ent, "targetname", "invisible_roundend"); DispatchKeyValueVector(ent, "orign", orign); DispatchSpawn(ent); } }
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon) { if (buttons & IN_RELOAD) { new g_iOffsetAmmo1 = FindSendPropOffs("CCSPlayer", "m_iAmmo"); new weapon1 = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); new g_iOffsetPrimaryAmmoType1 = FindSendPropInfo("CBaseCombatWeapon", "m_iPrimaryAmmoType"); new ammotype1 = GetEntData(weapon1, g_iOffsetPrimaryAmmoType1); if (ammotype1 != -1) { SetEntData(client, g_iOffsetAmmo1 + (ammotype1 * 4), 501); } } }
public Action:PlayerDisconnect_Event(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid")); if (IsClientInGame(client)) { if (GetClientTeam(client) == 2) { CPrintToChatAll(msg, "selecting random terrorist"); CreateTimer(4.5, randominv); } } }
public Action:randominv(Handle:timer) { new t = GetRandomPlayer(); for (new i=1;i<=MaxClients;i++) { if (IsClientInGame(i)) { if (GetClientTeam(i) == 2) { CS_SwitchTeam(i, 3); } } } if (t != -1) { xd = GetAlivePlayers(); if (xd > 10) { for (new y=1;y<=2;y++) { CPrintToChatAll(msg, "2 t's", xd); CS_SwitchTeam(t, 2); CS_RespawnPlayer(t); CPrintToChatAll(msg, "player go to terrorists", t); PrintCenterTextAll("Игрок %N выбран следующим невидимкой!", t); fff = 0; xd = 0; } } else { if (IsClientInGame(t)) { CPrintToChatAll(msg, "need more players for more t's", xd); CS_SwitchTeam(t, 2); CS_RespawnPlayer(t); CPrintToChatAll(msg, "player go to terrorists", t); PrintCenterTextAll("Игрок %N выбран следующим невидимкой!", t); fff = 0; xd = 0; } } } }
public Action:Event_ItemPickup(Handle:event, const String:name[], bool:dontBroadcast) { decl client; decl String:item[65]; client = GetClientOfUserId(GetEventInt(event,"userid")); GetEventString(event,"item",item,sizeof(item)); if (IsClientInGame(client) && IsPlayerAlive(client)) { if (GetClientTeam(client) == 2) { if(!StrEqual(item,"knife")) { decl entity; entity = GetPlayerWeaponSlot(client,2); if(entity != -1) { RemovePlayerWeapons(client); GivePlayerItem(client, "weapon_knife"); }
} else if (StrEqual(item,"knife")) { decl entity; entity = GetPlayerWeaponSlot(client,2); if(entity != -1) { SetEntityRenderMode(entity, RENDER_TRANSCOLOR); SetEntityRenderColor(entity, 255, 255, 255, 0); } } } } }
public Action:cmd_jointeam(client, args) { if (IsClientInGame(client)) { if (GetClientTeam(client) != CS_TEAM_T) { if (GetAliveT() > 0) { ChangeClientTeam(client, 3); CPrintToChat(client, msg2, "auto force", "ct"); tpt = 0; return Plugin_Handled; } else { ChangeClientTeam(client, 2); CPrintToChat(client, msg2, "auto force", "t"); tpt = 0; return Plugin_Handled; } } else if (GetClientTeam(client) == CS_TEAM_T) { CPrintToChat(client, msg, "terrorist suicide"); return Plugin_Handled; } else { CPrintToChat(client, msg, "only choosen can be a terrorist"); return Plugin_Handled; } } return Plugin_Handled; }
GetAliveT() { for (new x=1;x<=MaxClients;x++) { if (IsClientInGame(x)) { if (GetClientTeam(x) == 2) { tpt++; } } } return tpt; }
public Action:cmd_suicide(client, args) { if (GetClientTeam(client) == 2) { if (IsPlayerAlive(client)) { CPrintToChat(client, msg, "terrorist suicide"); return Plugin_Handled; } } return Plugin_Continue; }
public Action:cmd_spectate(client, args) { if (GetClientTeam(client) == 2) { if (IsPlayerAlive(client)) { CPrintToChat(client, msg, "terrorist suicide"); return Plugin_Handled; } return Plugin_Handled; } return Plugin_Continue; }
public Action:Event_RoundEndX(Handle:event, const String:name[], bool:dontBroadcast) { tpt = 0; ti = 0; xd = 0; fff = 0; if (player_tD == 1) { CPrintToChatAll(msg, "selecting random terrorist"); CreateTimer(4.5, randominv); } else { for (new xxx=1;xxx<=MaxClients;xxx++) { if (IsClientInGame(xxx) && GetClientTeam(xxx) == 2) { CPrintToChatAll(msg, "Player dont death", xxx); CreateTimer(300.0, RestartGame); } } } if (TeamRand_weapon == 0) { TeamRand_weapon = 1; } else if (TeamRand_weapon == 1) { TeamRand_weapon = 2; } else if (TeamRand_weapon == 2) { TeamRand_weapon = 3; } else if (TeamRand_weapon == 3) { TeamRand_weapon = 4; } else if (TeamRand_weapon == 4) { TeamRand_weapon = 5; } else if (TeamRand_weapon == 5) { TeamRand_weapon = 6; } else if (TeamRand_weapon == 6) { TeamRand_weapon = 0; } player_tD = 0; }
GetAlivePlayers() { for (new xsd=1;xsd<=MaxClients;xsd++) { if (IsClientInGame(xsd)) { fff++; } } return fff; }
RemovePlayerWeapons(client) { for (new x=0; x<=4; x++) { if (GetPlayerWeaponSlot(client, x) != -1) { RemovePlayerItem(client, GetPlayerWeaponSlot(client, x)); } } }
public Action:InvisActivateT(Handle:timer) { for (new x=1;x<=MaxClients;x++) { if (IsClientInGame(x) && IsPlayerAlive(x) && GetClientTeam(x) == 2) { CPrintToChat(x, msg, "invisible: activate invis"); SetEntityRenderMode(x, RENDER_TRANSCOLOR); SetEntityRenderColor(x, 255, 255, 255, 0); ti = 0; } } }
GetRandomPlayer() { new PlayerList[MaxClients]; new PlayerCount; for (new i = 1; i <= MaxClients; i++) { if (IsClientInGame(i)) { if (GetClientTeam(i) == 3) { if (IsPlayerAlive(i)) { PlayerList[PlayerCount++] = i; } } } } if (PlayerCount == 0) { return -1; } return PlayerList[GetRandomInt(0, PlayerCount-1)]; }
public Action:Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid")); if (GetClientTeam(client) == 2) { xd = GetAlivePlayers(); if (xd > 15) { CreateTimer(1.0, RegenHP2, client, TIMER_REPEAT); RemovePlayerWeapons(client); SetEntityRenderMode(client, RENDER_TRANSCOLOR); SetEntityRenderColor(client, 255, 255, 255, 0); SetEntityHealth(client, 300); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.6); SetEntityGravity(client, 0.35); CPrintToChat(client, msg, "Invisible!"); CPrintToChatAll(msg, "super invisible", client, xd); GivePlayerItem(client, "weapon_knife"); GivePlayerItem(client, "item_nvgs"); xd = 0; fff = 0; } else { CreateTimer(1.0, RegenHP, client, TIMER_REPEAT); RemovePlayerWeapons(client); SetEntityRenderMode(client, RENDER_TRANSCOLOR); SetEntityRenderColor(client, 255, 255, 255, 0); SetEntityHealth(client, 200); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.45); SetEntityGravity(client, 0.4); CPrintToChat(client, msg, "Invisible!"); GivePlayerItem(client, "weapon_knife"); GivePlayerItem(client, "item_nvgs"); xd = 0; fff = 0; } } else if (GetClientTeam(client) == 3) { CPrintToChat(client, msg, "CT's spawn msg"); RemovePlayerWeapons(client); SetEntityRenderMode(client, RENDER_TRANSCOLOR); SetEntityRenderColor(client, 255, 255, 255, 255); SetEntityHealth(client, 100); SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.0); SetEntityGravity(client, 1.0); GivePlayerItem(client, "weapon_knife"); GivePlayerItem(client, "item_nvgs"); if (TeamRand_weapon == 0) { GivePlayerItem(client, "weapon_p90"); } else if (TeamRand_weapon == 1) { GivePlayerItem(client, "weapon_m3"); } else if (TeamRand_weapon == 2) { GivePlayerItem(client, "weapon_tmp"); } else if (TeamRand_weapon == 3) { GivePlayerItem(client, "weapon_ak47"); } else if (TeamRand_weapon == 4) { GivePlayerItem(client, "weapon_mp5navy"); } else if (TeamRand_weapon == 5) { GivePlayerItem(client, "weapon_xm1014"); } else if (TeamRand_weapon == 6) { GivePlayerItem(client, "weapon_m4a1"); } new g_iOffsetAmmo = FindSendPropOffs("CCSPlayer", "m_iAmmo"); new weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); new g_iOffsetPrimaryAmmoType = FindSendPropInfo("CBaseCombatWeapon", "m_iPrimaryAmmoType"); new ammotype = GetEntData(weapon, g_iOffsetPrimaryAmmoType); if (ammotype != -1) { SetEntData(client, g_iOffsetAmmo + (ammotype * 4), 501); } } new GetCash = FindSendPropOffs("CCSPlayer", "m_iAccount"); SetEntData(client, GetCash, 1); new offsetOne = FindSendPropInfo("CCSPlayer", "m_hObserverTarget"); new offsetTwo = FindSendPropInfo("CCSPlayer", "m_iObserverMode"); new offsetThree = FindSendPropInfo("CCSPlayer", "m_bDrawViewmodel"); new offsetFour = FindSendPropInfo("CCSPlayer", "m_iFOV"); SetEntData(client, offsetOne, 0); SetEntData(client, offsetTwo, 1); SetEntData(client, offsetThree, 0); SetEntData(client, offsetFour, 120); // CheatCommand(client, "thirdperson"); // SetEntPropEnt(client, Prop_Send, "m_hObserverTarget", 0); // SetEntProp(client, Prop_Send, "m_iObserverMode", 1); // SetEntProp(client, Prop_Send, "m_bDrawViewmodel", 0); // ServerCommand("sv_cheats 0"); // new g_flFlashDuration = FindSendPropOffs("CCSPlayer", "m_flFlashDuration"); // new g_flFlashMaxAlpha = FindSendPropOffs("CCSPlayer", "m_flFlashMaxAlpha"); // SetThirdPersonView(client, true); // SetEntDataFloat(client, g_flFlashDuration, 10000.0, true); // SetEntDataFloat(client, g_flFlashMaxAlpha, 0.5, true); }
public Action:RestartGame(Handle:timer) { ServerCommand("sv_cheats 1"); ServerCommand("endround"); ServerCommand("sv_cheats 0"); }
CheatCommand(client, const String:command[]) { new Flagsgive = GetCommandFlags(command); SetCommandFlags(command, Flagsgive & ~FCVAR_CHEAT); ClientCommand(client, command); SetCommandFlags(command, Flagsgive | FCVAR_CHEAT); }
public Action:RegenHP(Handle:timer, any:client) { if (IsClientInGame(client) && GetClientTeam(client) == 2) { if (GetClientHealth(client) < 200) { SetEntityHealth(client, GetClientHealth(client) + 4); return Plugin_Continue; } } else { return Plugin_Stop; } return Plugin_Continue; }
public Action:RegenHP2(Handle:timer, any:client) { xd = GetAlivePlayers(); if (xd > 15) { if (IsClientInGame(client) && GetClientTeam(client) == 2) { if (GetClientHealth(client) < 300) { SetEntityHealth(client, GetClientHealth(client) + 8); xd = 0; fff = 0; return Plugin_Continue; } } else { return Plugin_Stop; } } else { return Plugin_Stop; } return Plugin_Continue; }
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) { new victim = GetClientOfUserId(GetEventInt(event, "userid")); new attacker = GetClientOfUserId(GetEventInt(event, "attacker")); if (GetClientTeam(victim) == 2 && GetClientTeam(attacker) == 3) { CPrintToChatAll(msg, "ct kill invisible", attacker, victim); player_tD = 1; } else if (GetClientTeam(victim) == 2) { player_tD = 1; } else { player_tD = 0; } }
public Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast) { new victim = GetClientOfUserId(GetEventInt(event, "userid")); new attacker = GetClientOfUserId(GetEventInt(event, "attacker")); if (ti == 0) { if (GetClientTeam(victim) == 2 && GetClientTeam(attacker) == 3) { CPrintToChatAll(msg, "invisible hurt", attacker, victim); SetEntityRenderMode(victim, RENDER_TRANSCOLOR); SetEntityRenderColor(victim, 255, 255, 255, 50); CreateTimer(2.0, InvisActivateT); ti = 1; } } else { if (GetClientTeam(victim) == 2 && GetClientTeam(attacker) == 3) { CPrintToChatAll(msg, "invisible hurt again", attacker, victim); } } }
public OnGameFrame() { for (new i=1;i<=MaxClients;i++) { if (IsClientInGame(i) && IsPlayerAlive(i)) { if (GetClientTeam(i) == 2) { SetEntityGravity(i, 0.4); } else { SetEntityGravity(i, 1.0); } } } }
bool:SetThirdPersonView(client, bool:third) { if (third) { SetEntPropEnt(client, Prop_Send, "m_hObserverTarget", 0); SetEntProp(client, Prop_Send, "m_iObserverMode", 1); SetEntProp(client, Prop_Send, "m_bDrawViewmodel", 0); SetEntProp(client, Prop_Send, "m_iFOV", 120); return true; } else { SetEntPropEnt(client, Prop_Send, "m_hObserverTarget", -1); SetEntProp(client, Prop_Send, "m_iObserverMode", 0); SetEntProp(client, Prop_Send, "m_bDrawViewmodel", 1); SetEntProp(client, Prop_Send, "m_iFOV", 90); return true; } }
=\\Добавлено (10.12.2011, 17:21) --------------------------------------------- ЗЫ пару фих взял с плагинов Еля! =\
|
|
| |