if killer id is a car
#1

How can i know if the killer is a guy with a car?

if(killerid == ??
Reply
#2

i supose
if(IsPlayerInAnyVehicle(killerid))
Reply
#3

You mean when the Killerid used a car to kill the player?

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInAnyVehiclekillerid))
    {
        SendClientmessagetoall(COLOR_RED, "The killer was in a car");
    }
    else
    {
        SendClientMessageToAll(COLOR_RED, "The killer wasn't in a car(so he was on foot)");
    }
    return 1;
}
I don't know if it is working 100% :$
Reply
#4

Quote:
Originally Posted by Wrath2k10
Посмотреть сообщение
You mean when the Killerid used a car to kill the player?

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInAnyVehiclekillerid))
    {
        SendClientmessagetoall(COLOR_RED, "The killer was in a car");
    }
    else
    {
        SendClientMessageToAll(COLOR_RED, "The killer wasn't in a car(so he was on foot)");
    }
    return 1;
}
I don't know if it is working 100% :$
Is this Correct?

else if(killerid != INVALID_PLAYER_ID && !IsPlayerInAnyVehicle(killerid))
Reply
#5

Quote:
Originally Posted by Ihsan_Cingisiz
Посмотреть сообщение
Is this Correct?

else if(killerid != INVALID_PLAYER_ID && !IsPlayerInAnyVehicle(killerid))
That detects if the killer is connected and isn't in a car. If that's what you mean, it should work.
Reply
#6

why not check for the reason?

wait a sec while i search for the id of the reason

EDIT: only weapons are listed in the reasons on the wiki.
srryt man.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)