Quote:
Originally Posted by Visual77
sounds more like it might be an event for when the tank is biled? why don't you try what it's for? hook the event, get the user id and print out a message.
|
I tried a similar code, but it really works only when a bile bomb thrown into the tank. I found a function with which it works as I need to:
PHP Code:
public OnPluginStart()
{
HookEvent("player_now_it", Event_NowVomit);
}
public Event_NowVomit(Handle:event, const String:name[], bool:dontBroadcast)
{
new thrower = GetClientOfUserId(GetEventInt(event, "attacker"));
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
if (IsClientInGame(thrower) && !IsFakeClient(thrower) && IsClientInGame(victim) && !IsFakeClient(victim) && !GetEventBool(event, "by_boomer"))
{
decl String:thrower_name[MAX_NAME_LENGTH], String:victim_name[MAX_NAME_LENGTH];
GetClientName(thrower, thrower_name, sizeof(thrower_name));
GetClientName(victim, victim_name, sizeof(victim_name));
PrintToChatAll("Player %s threw a bile bomb at %s!", thrower_name, victim_name);
}
}
In any case, thanks for responding. Earlier I wrote only in PHP, please check my code. Sorry for my english, im using gtranslate.