Textdraw kill - 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: Textdraw kill (
/showthread.php?tid=651718)
Textdraw kill -
Hunud - 26.03.2018
I made textdraw for my CnR. How to make whenever someone kill you, It will say in textdraw You are killed by: Hunud
My Textdraws. How to make function ? Thanks
Код:
Textdraw0 = TextDrawCreate(132.000000, 185.062500, "You are killed by:");
TextDrawLetterSize(Textdraw0, 0.282000, 1.267498);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, -1);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 1);
TextDrawBackgroundColor(Textdraw0, 51);
TextDrawFont(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
Re: Textdraw kill -
Nizarh - 26.03.2018
https://sampwiki.blast.hk/wiki/GetPlayerName
https://sampwiki.blast.hk/wiki/PlayerTextDrawShow
Re: Textdraw kill -
Maximun - 26.03.2018
Okay, you have to change this to 'Player Text' . If you understand what I mean, post another code with this type I said.
Re: Textdraw kill -
Nru - 26.03.2018
Here you go.
Код:
new PlayerText:Textdraw0[MAX_PLAYERS];
//you put this under OnPlayerConnect
Textdraw0[playerid] = PlayerTextDrawCreate(132.000000, 185.062500, "You are killed by:");
PlayerTextDrawLetterSize(Textdraw0[playerid], 0.282000, 1.267498);
PlayerTextDrawAlignment(Textdraw0[playerid], 1);
PlayerTextDrawColor(Textdraw0[playerid], -1);
PlayerTextDrawSetShadow(PlayerTextdraw0[playerid], 0);
PlayerTextDrawSetOutline(Textdraw0[playerid], 1);
PlayerTextDrawBackgroundColor(Textdraw0[playerid], 51);
PlayerTextDrawFont(Textdraw0[playerid], 1);
PlayerTextDrawSetProportional(Textdraw0[playerid], 1);
public OnPlayerDeath(playerid, killerid, reason)
{
new string[128];
format(string, sizeof(string),"You are killed by: %s",GetPlayerName(killerid));
PlayerTextDrawSetString(playerid, Textdraw0[playerid], string);
PlayerTextDrawShow(playerid, Textdraw0[playerid]);
return 1;
}
Re: Textdraw kill -
Grim_ - 26.03.2018
For example...
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID) {
new name[MAX_PLAYER_NAME+1], string[80];
GetPlayerName(killerid, name, sizeof(name));
format(string, sizeof(string), "You were killed by: %s", name);
TextDrawHideForPlayer(playerid, TD_ID);
TextDrawSetString(TD_ID, string);
TextDrawShowForPlayer(playerid, TD_ID);
}
}
Re: Textdraw kill -
Bolex_ - 26.03.2018
No need to hide textdraw in the moment when a specific player die (OPD). OPS is called, hide textdraw there.