Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdkhooks>
- #include <codmod>
- new const String:nazwa[] = "Tajemnica Zabojcy";
- new const String:opis[] = "Posiadasz 1/LW szans na wyrzucenie broni przeciwnika";
- new bool:ma_item[65],
- wartosc_itemu[65];
- public Plugin:myinfo =
- {
- name = nazwa,
- author = "Linux`",
- description = "Cod Item",
- version = "1.0",
- url = "http://steamcommunity.com/id/linux2006"
- };
- public OnPluginStart()
- {
- cod_register_item(nazwa, opis, 3, 6);
- }
- public OnClientPutInServer(client)
- {
- SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
- }
- public OnClientDisconnect(client)
- {
- SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
- }
- public cod_item_enabled(client, wartosc)
- {
- ma_item[client] = true;
- wartosc_itemu[client] = wartosc;
- }
- public cod_item_disabled(client)
- {
- ma_item[client] = false;
- }
- public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
- {
- if(!IsValidClient(attacker) || !ma_item[attacker])
- return Plugin_Continue;
- if(!IsValidClient(client) || GetClientTeam(client) == GetClientTeam(attacker))
- return Plugin_Continue;
- if(GetRandomInt(1, wartosc_itemu[attacker]) == 1)
- ClientCommand(client, "drop");
- return Plugin_Continue;
- }
Add Comment
Please, Sign In to add comment