Detect run over a actor -
binnyl - 26.04.2018
Would be possible to detect when player run over on a actor?
I mean, if player drive by actor == 5 {}
Re: Detect run over a actor -
CodeStyle175 - 26.04.2018
you stupid or what?
first just think a little bit how coding works even
Re: Detect run over a actor -
AdamsLT - 26.04.2018
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?
Re: Detect run over a actor -
Zeus666 - 26.04.2018
Quote:
Originally Posted by CodeStyle175
you stupid or what?
first just think a little bit how coding works even
|
Stop shit posting, and say "you stupid or what?"
after you stop asking questions like
PHP код:
//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
thanks
Re: Detect run over a actor -
CodeStyle175 - 26.04.2018
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
Re: Detect run over a actor -
Zeus666 - 26.04.2018
Quote:
Originally Posted by CodeStyle175
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
|
Wtf is wrong with me?
nothing.
something is wrong with you.
You are arguing with someone who doesn't know how to pawn (script) and asks to scripting help.
That's why this section exists, to ask stupidest questions because you get answers and you learn something
Not to receive answers like
PHP код:
you stupid or what?
first just think a little bit how coding works even
even if I ask
"how to send client message to a player"
you should answer me with the answer, not with sarcastic answer
Re: Detect run over a actor -
binnyl - 29.04.2018
Quote:
Originally Posted by CodeStyle175
you stupid or what?
first just think a little bit how coding works even
|
I'm stupid, you are so smart
Quote:
Originally Posted by AdamsLT
|
Could you help me with that?
I've tried this:
Код:
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;
}
But nothing is printing
Thank you @Zeus666, but just ignore, that guy clearly have problems.
Re: Detect run over a actor -
binnyl - 01.05.2018
bump
Re: Detect run over a actor -
jasperschellekens - 01.05.2018
Quote:
Originally Posted by binnyl
bump
|
Can u explain more specific which part is not working?
Re: Detect run over a actor -
binnyl - 02.05.2018
Quote:
Originally Posted by jasperschellekens
Can u explain more specific which part is not working?
|
There are no errors, it compiling, but when i ran over, drive by a actor, it not showing the messagetoall, that should means that is not detecting
Re: Detect run over a actor -
NaS - 02.05.2018
Because that is not detectable by SAMP. The callback doesn't call for vehicle damage - only for shots and melee.
Re: Detect run over a actor -
weex - 02.05.2018
Quote:
Originally Posted by NaS
Because that is not detectable by SAMP. The callback doesn't call for vehicle damage - only for shots and melee.
|
I would like to detect too, there isn't another way to detect?
Is this possible?
Re: Detect run over a actor -
git - 02.05.2018
Quote:
Originally Posted by NaS
Because that is not detectable by SAMP. The callback doesn't call for vehicle damage - only for shots and melee.
|
You can check if weapon id is equal to id 49, because on the wiki it says that for vehicle.
Re: Detect run over a actor -
XWolfX - 02.05.2018
In my opinion u should use
IsPlayerInRangeOfPoint(actorcords), if actor is static(standing in one point).
Something like this
PHP Code:
if (IsPlayerInRangeOfPoint(playerid, 0.1, 2695.6880, -1704.6300, 11.8438) && GetPlayerVehicleID(playerid) != 0)
{
SendClientMessageToAll(colorid,"Bla Bla");
}