SA-MP Forums Archive
How can i know in the script when the player kills someone..? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can i know in the script when the player kills someone..? (/showthread.php?tid=164619)



How can i know in the script when the player kills someone..? - Ihsan_Cingisiz - 01.08.2010

I have this script for if you die, but i want to know how i can know who i have killed and whith which weapon..

new kname[128];
new string[128];
GetPlayerName(killerid, kname, sizeof(kname));
format(string, sizeof(string), ">> %s has killed you.", kname);
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[playerid][Deaths] += 1;
SendClientMessage(playerid, COLOR_DARKRED, string);


Re: How can i know in the script when the player kills someone..? - Ash. - 01.08.2010

Use this, and cases for the reason (according to the wiki, the reason is the weapon of which killed the player)

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



Re: How can i know in the script when the player kills someone..? - Jay. - 01.08.2010

Quote:
Originally Posted by Ihsan_Cingisiz
Посмотреть сообщение
I have this script for if you die, but i want to know how i can know who i have killed and whith which weapon..

new kname[128];
new string[128];
GetPlayerName(killerid, kname, sizeof(kname));
format(string, sizeof(string), ">> %s has killed you.", kname);
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[playerid][Deaths] += 1;
SendClientMessage(playerid, COLOR_DARKRED, string);
I'm %100 percent sure you copyed that because if you made it you would no what these things do.


Re: How can i know in the script when the player kills someone..? - Ash. - 01.08.2010

Quote:
Originally Posted by [BADBOY]
Посмотреть сообщение
I'm %100 percent sure you copyed that because if you made it you would no what these things do.
Agreed, i meant to mention that in my first post lol ¬¬


Re: How can i know in the script when the player kills someone..? - Dolph - 01.08.2010

And please make your strings smaller. You dont need 128 strings for sentences that has 20(-) letters