Detect run over a actor
#1

Would be possible to detect when player run over on a actor?
I mean, if player drive by actor == 5 {}
Reply
#2

you stupid or what?
first just think a little bit how coding works even
Reply
#3

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?
Reply
#4

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 008must be a constant expressionassumed zero
error 048
: array dimensions do not match 
thanks
Reply
#5

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
Reply
#6

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
Reply
#7

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
Посмотреть сообщение
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?
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.
Reply
#8

bump
Reply
#9

Quote:
Originally Posted by binnyl
Посмотреть сообщение
bump
Can u explain more specific which part is not working?
Reply
#10

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
Reply
#11

Because that is not detectable by SAMP. The callback doesn't call for vehicle damage - only for shots and melee.
Reply
#12

Quote:
Originally Posted by NaS
View Post
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?
Reply
#13

Quote:
Originally Posted by NaS
View Post
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.
Reply
#14

In my opinion u should use IsPlayerInRangeOfPoint(actorcords), if actor is static(standing in one point).
Something like this
PHP Code:
 if (IsPlayerInRangeOfPoint(playerid0.12695.6880, -1704.630011.8438) && GetPlayerVehicleID(playerid) != 0
    {
        
SendClientMessageToAll(colorid,"Bla Bla");
    } 
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)