Advertisement
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[] = "Chorąży [OD 200LVL]";
- new const String:opis[] = "Bardzo szybki, mag7 i tec9 po +10DMG(+int)";
- new const String:bronie[] = "#weapon_mag7#weapon_tec9";
- new const inteligencja = 5;
- new const zdrowie = 10;
- new const obrazenia = 0;
- new const wytrzymalosc = 20;
- new const kondycja = 65;
- bool ma_klase[MAXPLAYERS + 1];
- public OnPluginStart()
- {
- CreateConVar(nazwa, "1.0", "Linux`");
- CreateTimer(0.3, zaladuj);
- }
- public Action zaladuj(Handle timer)
- {
- cod_register_class(nazwa, opis, bronie, inteligencja, zdrowie, obrazenia, wytrzymalosc, kondycja);
- }
- public cod_class_enabled(client)
- {
- new bool:ma_poziom = false;
- new poziom_dozwolony = 200;
- for(new i = 1; i <= cod_get_classes_num(); i ++)
- {
- if(cod_get_user_level(client, i) >= poziom_dozwolony)
- {
- ma_poziom = true;
- break;
- }
- }
- if(ma_poziom)
- {
- ma_klase[client] = true;
- }
- else
- {
- if(cod_get_user_class(client))
- cod_set_user_class(client, 0, 1);
- if(cod_get_user_item(client))
- cod_set_user_item(client, 0, 0, 0);
- CPrintToChat(client, "[COD:MW]{RED} Wybrana klasa dostepna jeśli na którejś klasie masz conajmniej %i Lvl!", poziom_dozwolony);
- }
- }
- public cod_class_disabled(client)
- {
- ma_klase[client] = false;
- }
- 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])
- return Plugin_Continue;
- if(cod_get_user_item(victim) == cod_get_itemid("Betonowa Głowa") && damagetype & CS_DMG_HEADSHOT)
- return Plugin_Continue;
- if(odporny(victim))
- return Plugin_Handled;
- if(damagetype & DMG_BULLET)
- {
- int obrazenia_gracza = 10+RoundToZero((cod_get_user_intelligence(attacker, 1, 1, 1)*0.5));
- cod_inflict_damage(victim, attacker, 0, obrazenia_gracza);
- }
- return Plugin_Changed;
- }
- public OnClientPutInServer(client)
- {
- SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
- }
- public OnClientDisconnect(client)
- {
- SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement