help death
#1

hello people I have a problem I put textdraw style gta v but when dying by suicide or fall from high appears the same name the qe I kill I want to put another textdraw qe tell you has committed suicide



new kname[MAX_PLAYER_NAME]; //killername
GetPlayerName(killerid, kname, sizeof(kname));
format(pstring, sizeof(pstring), "YOU GOT KILLED BY ~R~%s",kname);
TextDrawSetString(Textdraw5, pstring);
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerDeath - Last parameter is Death Reason. If reason is Suicide or, 255 show You have committed suicide or else show your other message.
Reply
#3

When a player commits suicide the 'killerid' becomes equal to INVALID_PLAYER_ID.
Put this inside 'OnPlayerDeath' callback.
Код:
if(killerid==INVALID_PLAYER_ID)
{
     //Tell the player about suicide
}
Reply
#4

What I do, but how can I do, every time I die, detect the name, commit suicide and put the text.
Reply
#5

I just gave you a link ti WIKI Page. Refer it. No one's gonna get you a ready made code. You have to learn it. Its for your own sake. This is a very difficult time for SAMP developers. If you dont know anything better than others, you wont last a day.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)