Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdkhooks>
- #include <sdktools>
- #include <cstrike>
- #include <codmod>
- new const String:nazwa[] = "El Pistolero";
- new const String:opis[] = "Moduł odrzutowy co 5s(CTRL+SPACE), Może kupić każdy pistolet\n15%% redukcji obrażeń, +25 DMG do pistoletów";
- new const String:bronie[] = "#weapon_p250#weapon_p250";
- new const inteligencja = 0;
- new const zdrowie = 20;
- new const obrazenia = 0;
- new const wytrzymalosc = 20;
- new const kondycja = 20;
- bool ma_klase[MAXPLAYERS+1];
- float wartosc_itemu[MAXPLAYERS+1];
- char pistolety[][] =
- {
- "glock",
- "usp_silencer",
- "hkp2000",
- "p250",
- "tec9",
- "fiveseven",
- "cz75a",
- "deagle",
- "revolver",
- "elite"
- };
- public Action CS_OnBuyCommand(int client, const char[] weapon)
- {
- if(!ma_klase[client]) return Plugin_Continue;
- for(int i = 0; i<sizeof(pistolety); i++)
- {
- if(StrEqual(weapon, pistolety[i]))
- {
- return Plugin_Continue;
- }
- }
- return Plugin_Handled;
- }
- public OnPluginStart()
- {
- CreateTimer(5.0, zaladuj);
- CreateConVar(nazwa, "1.0", "Linux`");
- HookEvent("player_spawn", OdrodzenieGracza);
- }
- public cod_class_skill_used(client)
- {
- if(GetGameTime() < wartosc_itemu[client]+5.0)
- {
- //do nothing
- }
- else
- {
- new Float:velocity[3];
- new Float:velocity0;
- new Float:velocity1;
- velocity0 = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[0]");
- velocity1 = GetEntPropFloat(client, Prop_Send, "m_vecVelocity[1]");
- velocity[0] = (16.0*velocity0)*(1.0/4.1);
- velocity[1] = (16.0*velocity1)*(1.0/4.1);
- velocity[2] = 0.0;
- SetEntPropVector(client, Prop_Send, "m_vecBaseVelocity", velocity);
- wartosc_itemu[client] = GetGameTime();
- }
- }
- public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])
- {
- if(GetGameTime() < wartosc_itemu[client]+5.0) return;
- if( (buttons & IN_JUMP) && (buttons & IN_DUCK) )
- {
- if(ma_klase[client])
- ClientCommand(client, "useclass");
- }
- }
- public Action:OdrodzenieGracza(Handle:event, String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- if(!IsValidClient(client) || !ma_klase[client])
- return;
- if(wartosc_itemu[client] != 0.0)
- wartosc_itemu[client] = 0.0;
- }
- public Action zaladuj(Handle timer)
- {
- cod_register_class(nazwa, opis, bronie, inteligencja, zdrowie, obrazenia, wytrzymalosc, kondycja);
- }
- public cod_class_enabled(client)
- {
- ma_klase[client] = true;
- wartosc_itemu[client] = 0.0;
- }
- public cod_class_disabled(client)
- {
- ma_klase[client] = false;
- wartosc_itemu[client] = 0.0;
- }
- public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
- {
- if(!IsValidClient(victim) || !IsValidClient(attacker))
- return Plugin_Continue;
- if(GetClientTeam(victim) == GetClientTeam(attacker))
- return Plugin_Continue;
- if(!ma_klase[attacker])
- {
- if(!ma_klase[victim])
- return Plugin_Continue;
- else
- {
- if(GetRandomInt(1, 8) == 1)
- {
- damage = 0.0;
- return Plugin_Changed;
- }
- }
- }
- if(cod_get_user_item(victim) == cod_get_itemid("Betonowa Głowa") && damagetype & CS_DMG_HEADSHOT)
- return Plugin_Continue;
- if(odporny(victim))
- return Plugin_Continue;
- if(damagetype & DMG_BULLET || damagetype & DMG_SLASH)
- {
- cod_inflict_damage(victim, attacker, 1, 25);
- }
- return Plugin_Changed;
- }
- public cod_skill_class_used(client)
- {
- new zdrowie_gracza = GetClientHealth(client);
- new maksymalne_zdrowie = zdrowie_gracza+cod_get_user_health(client, 1, 1, 1);
- int nowe_zdrowie = maksymalne_zdrowie+65;
- SetEntData(client, FindDataMapOffs(client, "m_iHealth"), nowe_zdrowie);
- }
Advertisement
Add Comment
Please, Sign In to add comment