26.04.2018, 06:26
Would be possible to detect when player run over on a actor?
I mean, if player drive by actor == 5 {}
I mean, if player drive by actor == 5 {}
you stupid or what?
first just think a little bit how coding works even |
//just an example
new arr[MAX_PLAYERS][50][2];
arr[playerid]={{0,1},{0,2}};
//errors
error 008: must be a constant expression; assumed zero
error 048: array dimensions do not match
wtf is wrong with you zeus666?
in c# you can create dynamic matrix but pwn doesn't let you create matrix like that, i thought there was workaround. and don't try to be smartass |
you stupid or what?
first just think a little bit how coding works even
you stupid or what?
first just think a little bit how coding works even |
https://sampwiki.blast.hk/wiki/OnPlayerGiveDamageActor
and https://sampwiki.blast.hk/wiki/Weapons The callback has a parameter weaponid. If the weapon is a car, the weaponid is 49. So, when a player does damage to an actor with a vehicle, the callback would give weaponid 49. You should be able to do that check and do whatever you want with that data. Is this what you are looking for? |
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart) { if(weaponid == 49) { new string[128], attacker[MAX_PLAYER_NAME]; new weaponname[24]; GetPlayerName(playerid, attacker, sizeof (attacker)); GetWeaponName(weaponid, weaponname, sizeof (weaponname)); format(string, sizeof(string), "%s has made %.0f damage to actor id %d, weapon: %s", attacker, amount, damaged_actorid, weaponname); SendClientMessageToAll(0xFFFFFFFF, string); } return 1; }
if (IsPlayerInRangeOfPoint(playerid, 0.1, 2695.6880, -1704.6300, 11.8438) && GetPlayerVehicleID(playerid) != 0)
{
SendClientMessageToAll(colorid,"Bla Bla");
}