SA-MP Forums Archive
PlayerId - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayerId (/showthread.php?tid=494844)



PlayerId - lsreskjn - 14.02.2014

Код:
format(string,sizeof string,"{C0C0C0}[ KILL-LIST ] Hrбc %s (ID:%i) zabil %s (ID:%i).",killername, playerid, playername, playerid);
Im not sure how to do it, I want the message to looks like this Plazer xxx (ID:0) killed player (ID:1)

But the player id in message its same


Re: PlayerId - Threshold - 14.02.2014

pawn Код:
format(string,sizeof string,"{C0C0C0}[ KILL-LIST ] Hrбc %s (ID:%i) zabil %s (ID:%i).",killername, killerid, playername, playerid);



Re: PlayerId - AnthonyTimmers - 15.02.2014

Quote:
Originally Posted by lsreskjn
Посмотреть сообщение
Код:
format(string,sizeof string,"{C0C0C0}[ KILL-LIST ] Hrбc %s (ID:%i) zabil %s (ID:%i).",killername, playerid, playername, playerid);
Im not sure how to do it, I want the message to looks like this Plazer xxx (ID:0) killed player (ID:1)

But the player id in message its same
You need to get the id of the killer and save it somewhere, such as killerid or just id.


Re: PlayerId - Abreezy - 15.02.2014

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

    new string[128], kname[MAX_PLAYER_NAME+1], pname[MAX_PLAYER_NAME+1];
    GetPlayerName(killerid, kname, sizeof(kname));
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "> Player %s (ID:%d) has killed Player %s (ID:%d)", kname, killerid, pname, playerid);
    // Do whatever here to send it to whoever you want

    return 1;
}