I've tryed doing "if (IsPlayerInAnyVehicle(killerid))" and "if(reason == 29 && IsPlayerInAnyVehicle(killerid)) (29 = SMG)
Neither worked. Any idea?
Код:
OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerInAnyVehicle(killerid))
{
if(reason == 28 || reason == 29 || reason == 32)
{
new Float:tmpx, Float:tmpy, Float:tmpz;
GetPlayerPos(playerid, tmpx, tmpy, tmpz);
SendClientMessage(killerid, 0xff0000ff, "Driveby detected. You have been kicked.");
SendClientMessage(playerid, 0x000000ff, "You have been killed by driveby, you will now respawn where you died.");
SpawnPlayer(playerid);
SetPlayerHealth(playerid, 100);
SetPlayerPos(playerid, tmpx, tmpy, tmpz);
Kick(killerid);
}
}
return 1;
}