Textdraw kill
#1

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

Код:
new Text:Textdraw0
Код:
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);
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerName
https://sampwiki.blast.hk/wiki/PlayerTextDrawShow
Reply
#3

Okay, you have to change this to 'Player Text' . If you understand what I mean, post another code with this type I said.
Reply
#4

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;
}
Reply
#5

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);
    }
}
Reply
#6

No need to hide textdraw in the moment when a specific player die (OPD). OPS is called, hide textdraw there.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)