Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdkhooks>
- #include <sdktools>
- #include <codmod>
- #include <emitsoundany>
- new const String:nazwa[] = "[VIP] Sławek";
- new const String:opis[] = "Stawia wybuchowa gasnice-teleport, moc +int";
- new const String:bronie[] = "#weapon_aug#weapon_glock#weapon_hegrenade#weapon_flashbang#weapon_flashbang#weapon_smokegrenade";
- new const inteligencja = 0;
- new const zdrowie = 10;
- new const obrazenia = 10;
- new const wytrzymalosc = 20;
- new const kondycja = 0;
- int g_iPlayerTime[MAXPLAYERS];
- new bool:ma_klase[65],
- ilosc_ladunkow_gracza[65],
- podlozony_ladunek_gracza[65];
- new Float: SAVELOC[MAXPLAYERS + 1][3];
- Float: ResetVector[3] = {0.0, 0.0, 0.0};
- new sprite_explosion;
- ConVar cododepchniecie;
- #define PREFIX "\x01\x0B \x02[cs-placzabaw.pl]\x01"
- #define KURWAMAC "surf_dzwieki/teleport1.mp3"
- public Plugin:myinfo =
- {
- name = nazwa,
- author = "Linux`",
- description = "Cod Klasa",
- version = "1.0",
- url = "http://steamcommunity.com/id/linux2006"
- };
- public OnPluginStart()
- {
- cod_register_class(nazwa, opis, bronie, inteligencja, zdrowie, obrazenia, wytrzymalosc, kondycja);
- HookEvent("player_spawn", OdrodzenieGracza);
- HookEvent("player_death", SmiercGracza);
- cododepchniecie = CreateConVar("cododepchniecie", "50", "Szybkosc lotu odepchnietego");
- }
- public void OnClientPutInServer(int client)
- {
- g_iPlayerTime[client]=0;
- }
- public void OnMapStart()
- {
- PrecacheModel("models/props/cs_office/fire_extinguisher.mdl");
- sprite_explosion = PrecacheModel("materials/sprites/blueflare1.vmt");
- AddFileToDownloadsTable("sound/surf_dzwieki/teleport1.mp3");
- PrecacheSoundAny(KURWAMAC, true);
- }
- public cod_class_enabled(client)
- {
- ma_klase[client] = true;
- ilosc_ladunkow_gracza[client] = 3;
- if(GetUserFlagBits(client) & ADMFLAG_RESERVATION)
- {
- ma_klase[client] = true;
- return COD_CONTINUE;
- }
- PrintToChat(client, "%s Klasa dostępna tylko dla posiadaczy VIP", PREFIX);
- return COD_STOP;
- }
- public cod_class_disabled(client)
- {
- ma_klase[client] = false;
- ilosc_ladunkow_gracza[client] = 0;
- StopLadunek(client);
- }
- public cod_class_skill_used(client)
- {
- if(podlozony_ladunek_gracza[client] && IsValidEntity(podlozony_ladunek_gracza[client]) && g_iPlayerTime[client]<=GetTime())
- {
- podlozony_ladunek_gracza[client] = 1;
- EmitSoundToAllAny(KURWAMAC, client);
- CreateTimer(1.8, KURWAMACC, client);
- g_iPlayerTime[client]=GetTime()+5;
- }
- else if(!ilosc_ladunkow_gracza[client])
- PrintToChat(client, "%s Wykorzystales juz moc swojej klasy w tym zyciu!", PREFIX);
- else
- {
- podlozony_ladunek_gracza[client] = CreateEntityByName("hegrenade_projectile");
- if(podlozony_ladunek_gracza[client] != -1)
- {
- GetClientAbsOrigin(client, SAVELOC[client]);
- new Float:forigin[3];
- GetClientEyePosition(client, forigin);
- new Float:fangles[3];
- GetClientEyeAngles(client, fangles);
- new Float:iangles[3] = {0.0, 0.0, 0.0};
- iangles[1] = fangles[1];
- DispatchSpawn(podlozony_ladunek_gracza[client]);
- ActivateEntity(podlozony_ladunek_gracza[client]);
- SetEntityModel(podlozony_ladunek_gracza[client], "models/props/cs_office/fire_extinguisher.mdl");
- SetEntityMoveType(podlozony_ladunek_gracza[client], MOVETYPE_STEP);
- TeleportEntity(podlozony_ladunek_gracza[client], forigin, iangles, NULL_VECTOR);
- SetEntProp(podlozony_ladunek_gracza[client], Prop_Send, "m_usSolidFlags", 12);
- SetEntProp(podlozony_ladunek_gracza[client], Prop_Data, "m_nSolidType", 6);
- SetEntProp(podlozony_ladunek_gracza[client], Prop_Send, "m_CollisionGroup", 1);
- ReplyToCommand(client, "Podłożyłeś gaśnicę! Użyj ponownie, aby się do niej przenieść!", PREFIX);
- ilosc_ladunkow_gracza[client] = 0;
- }
- }
- }
- public Action:StopLadunek(client)
- {
- if(podlozony_ladunek_gracza[client])
- {
- if(IsValidEntity(podlozony_ladunek_gracza[client]))
- AcceptEntityInput(podlozony_ladunek_gracza[client], "Kill");
- podlozony_ladunek_gracza[client] = 0;
- }
- return Plugin_Continue;
- }
- public Action:OdrodzenieGracza(Handle:event, String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- if(!IsValidClient(client) || !ma_klase[client])
- return Plugin_Continue;
- StopLadunek(client);
- ilosc_ladunkow_gracza[client] = 3;
- return Plugin_Continue;
- }
- public Action:SmiercGracza(Handle:event, String:name[], bool:dontbroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- if(!IsValidClient(client) || !ma_klase[client])
- return Plugin_Continue;
- StopLadunek(client);
- return Plugin_Continue;
- }
- public Action:KURWAMACC(Handle:timer, client)
- {
- if(!IsValidClient(client) || !ma_klase[client])
- {
- new Float: pos[3];
- new Float:forigin[3], Float:iorigin[3];
- GetEntPropVector(podlozony_ladunek_gracza[client], Prop_Send, "m_vecOrigin", forigin);
- pos = SAVELOC[client];
- TeleportEntity(client, pos, NULL_VECTOR, ResetVector);
- new damage = 20+(cod_get_user_maks_intelligence(client));
- for(new i = 1; i <= MaxClients; i++)
- {
- if(!IsClientInGame(i) || !IsPlayerAlive(i))
- continue;
- if(GetClientTeam(client) == GetClientTeam(i))
- continue;
- GetClientEyePosition(i, iorigin);
- if(GetVectorDistance(forigin, iorigin) <= 450.0)
- {
- cod_inflict_damage(i, client, damage);
- }
- }
- TE_SetupExplosion(forigin, sprite_explosion, 20.0, 1, 0, 100, 1000);
- TE_SendToAll();
- ForcePush(client);
- StopLadunek(client);
- }
- return Plugin_Continue;
- }
- public void ForcePush(int client)
- {
- float clientPos[3], enemyPos[3], pushVel[3];
- GetClientAbsOrigin(client, clientPos);
- for (int i = 1; i <= MaxClients; i++)
- {
- if(!IsValidClient(i) || !IsPlayerAlive(i))
- continue;
- if(GetClientTeam(i) == GetClientTeam(client))
- continue;
- GetClientAbsOrigin(i, enemyPos);
- float distance = GetVectorDistance(enemyPos, clientPos);
- //Avoid dividing by 0
- distance = (distance > 0.0) ? distance : 1.0;
- if(distance > 450)
- continue;
- SubtractVectors(clientPos, enemyPos, pushVel);
- pushVel[0] = -pushVel[0];
- pushVel[1] = -pushVel[1];
- pushVel[2] = cododepchniecie.FloatValue;
- ScaleVector(pushVel, cod_get_user_maks_intelligence(client)*0.8);
- TeleportEntity(i, NULL_VECTOR, NULL_VECTOR, pushVel);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement