Posts: 1,111
Threads: 52
Joined: Nov 2008
Reputation:
0
Yes, I know there has been many topics about this. But I can't figure out to do this, I have searched, but couldnt get a good match.
I want a textdraw (I know how to create them), that shows how many kills and deaths you have got.
I know its something with TextDrawSetString, but.. How do I do this?
Posts: 2,593
Threads: 38
Joined: Aug 2007
Reputation:
0
I'm assuming you're keeping a variable per player with kills and deaths.
OnPlayerDeath(playerid,killerid,reason)
{
Kills[killerid]++;
Deaths[playerid]++;
new string[100];
format(string,sizeof(string),"Kills:%d -- Deaths:%d",Kills[playerid],Deaths[playerid]);
TextDrawSetString(KillsDeathsText[playerid],string);
format(string,sizeof(string),"Kills:%d -- Deaths:%d",Kills[killerid],Deaths[killerid]);
TextDrawSetString(KillsDeathsText[killerid],string);
}
Posts: 2,593
Threads: 38
Joined: Aug 2007
Reputation:
0
heh, forgot
//OnPlayerConnect
OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid,KillsDeathsText[playerid]);
}
Posts: 2,593
Threads: 38
Joined: Aug 2007
Reputation:
0
should be
KillsDeathsText[playerid];
and make sure when you did
new Text:KillsDeathsText[MAX_PLAYERS];
that you added the "Text:"
Posts: 2,593
Threads: 38
Joined: Aug 2007
Reputation:
0
anytime you refer to KillsDeathsText, it should show what player, in most cases "KillsDeathsText[playerid]" is what you're writing to