if killer id is a car - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: if killer id is a car (
/showthread.php?tid=168269)
if killer id is a car -
Ihsan_Cingisiz - 15.08.2010
How can i know if the killer is a guy with a car?
if(killerid == ??
Re: if killer id is a car -
akis_tze - 15.08.2010
i supose
if(IsPlayerInAnyVehicle(killerid))
Re: if killer id is a car -
Wrath2k10 - 15.08.2010
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% :$
Re: if killer id is a car -
Ihsan_Cingisiz - 15.08.2010
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))
Re: if killer id is a car -
Hiddos - 15.08.2010
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.
Re: if killer id is a car -
legodude - 15.08.2010
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.