Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include sdktools
- public OnPluginStart()
- {
- HookEvent("player_hurt", EventHurt);
- }
- public Action EventHurt(Event event, const char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(GetEventInt(event, "userid"))
- if(bIsSurvivor(client))
- {
- for(int i = 1; i <= GetRandomInt(4, 20); ++i)
- {
- BloodSpray(client)
- }
- }
- }
- stock BloodSpray(iClient)
- {
- new iEnt = CreateEntityByName("env_blood");
- if (iEnt == -1)
- DispatchSpawn(iEnt);
- DispatchKeyValue(iEnt, "spawnflags", "13");
- DispatchKeyValue(iEnt, "amount", "100");
- AcceptEntityInput(iEnt, "EmitBlood", iClient);
- RemoveEdict(iEnt);
- }
- stock bool bIsSurvivor(int client)
- {
- return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
- }
Advertisement
Add Comment
Please, Sign In to add comment