Kill a player in a specific place
#1

Hello!

Is it possible to ex kick/ban or reduce score for the killer ID that kills a another player who stands at a specific coord or nearby?
Reply
#2

Check out IsPlayerInRangeOfPOint @ the wiki
Reply
#3

pawn Код:
public OnPlayerDeath(playerid,kilerid,reason)
{
if(IsPlayerInArea(killerid,minx,maxx,miny,maxy)
{
Kick(killerid);//Ban(..)
}
}
pawn Код:
public IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if (x > minx && x < maxx && y > miny && y < maxy) return 1;
    return 0;
}
Reply
#4

Now i mean that it need to check if the killed player is/was in the aria, and then kick/or what ever the killer.
Reply
#5

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInRangeOfPoint(killerid, 5, X, Y, Z)) { // 5 -> distance and the coordinates
        Kick(killerid);
        // Do something
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Dwane
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInRangeOfPoint(killerid, 5, X, Y, Z)) { // 5 -> distance and the coordinates
        Kick(killerid);
        // Do something
    }
    return 1;
}
And this kicks the killer if the killed player dies in range of that point? even if the killer stands far away from that point and kill him with ex rocket launcher?
Reply
#7

Quote:
Originally Posted by cruising
Посмотреть сообщение
And this kicks the killer if the killed player dies in range of that point? even if the killer stands far away from that point and kill him with ex rocket launcher?
If the killerid kills the playerid into the range (distance: 5), he will be kicked.
In that case you mention, if killerid isn't in range like with Rocket or Minigun, he will not be kicked.
Reply
#8

Quote:
Originally Posted by Dwane
Посмотреть сообщение
If the killerid kills the playerid into the range (distance: 5), he will be kicked.
In that case you mention, if killerid isn't in range like with Rocket or Minigun, he will not be kicked.
But it was like that i wanted it to be, the last thing you said
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)