OnPlayerDeath killer problem..
#1

So i made a script where a player1 writes a command that kills player2..
For example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/boom", cmdtext, true, 10) == 0)
    {
        CreateExplosion(player2x, player2y, player2z, 7, 10.0);  //this kills player 2
        return 1;
    }
    return 0;
}
How to create a SendDeathMessage() so this kill will be shown in kill list..

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

        if(IsPlayerInRangeOfPoint(playerid,30,player2x,player2y,player2z))
        {
        SendDeathMessage(killer,playerid, reason);  //how to set that killer is that player who wrote /boom cmd to kill player 2?
        }
    }
    return 1;
}
Reply
#2

I would suggest you to use zcmd and sscanf. (sscanf isn't needed, but i prefer using it)

pawn Код:
command(boom, playerid, params[])
{
     new pID;
     if(sscanf(params, "u", pID)) return SendClientMessage(playerid, COLOR, "usage: /boom [ playerid / name ]");
     // GetPlayerPos(pID, x, y, z) and shiiit here.
     CreateExplosion(player2x, player2y, player2z, 7, 10.0);  //this kills player 2    
     return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)