SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/05/2014, 11:32 AM   #1
monster010
Huge Clucker
 
Join Date: Apr 2009
Posts: 232
Reputation: 0
Post [HELP] Killed by *

I tried to make a SendClientMesaje whe killed by the killer.

Eg: * You got killed by Father *

pawn Code:
GetPlayerName(killerrid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Killed by %s *", killerid);

I put these at:
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
monster010 is offline   Reply With Quote
Old 02/05/2014, 11:34 AM   #2
Eth
Gangsta
 
Eth's Avatar
 
Join Date: Sep 2013
Location: Egypt,مصر
Posts: 791
Reputation: 72
Default Re: [HELP] Killed by *

any place in your gamemode:
pawn Code:
stock GetName(playerid)
{
    new pName[24];
    GetPlayerName(playerid, (pName), sizeof(pName));
    return pName;
}
onplayerdeath:
pawn Code:
new string[256];
format(string, sizeof(string), "* Killed by %s *", GetName(killerid));
SendClientMessage(playerid,-1,string);
__________________
Left SAMP, yes..For real
Born on : 2000, 04, 12
Eth is offline   Reply With Quote
Old 02/05/2014, 11:40 AM   #3
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: [HELP] Killed by *

You have it as:
pawn Code:
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Killed by %s *", killerid);

but you first need to format and then send the formatted message:
pawn Code:
format(string, sizeof(string), "* Killed by %s *", killerid);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GameForPlayer after killed kbalor Scripting Help 27 27/06/2012 10:35 AM
When a player gets killed nothing happens. BleverCastard Scripting Help 5 13/05/2012 07:57 PM
[FilterScript] [FS] Who Killed Me? Z-R0 Filterscripts 36 14/02/2012 09:14 AM
Can u detect killed by rpg and who killed him? also with grenade and satchel? chrism11 Server Support 2 29/01/2012 01:03 PM
Who killed Who script. really need help MeNMyselv Help Archive 6 19/07/2011 06:47 PM


All times are GMT. The time now is 07:41 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.