Textdraw
#5

Quote:
Originally Posted by SilentHuntR
well then add the following:


pawn Код:
//Outside of any callbacks
new Kills[MAX_PLAYERS]; //Kills count
new Deaths[MAX_PLAYERS]; //Deaths count
new Text:KillsDeathsText[MAX_PLAYERS]; //The textdraw it will go on

//OnGameModeInit
OnGameModeInit()
{
for(new playerid;playerid<MAX_PLAYERS;playerid++)KillsDeathsText[playerid]=TextDrawCreate(10.0,460.0,"-");
}


//OnPlayerConnect
OnPlayerConnect(playerid)
{
Kills[playerid]=0;
Deaths[playerid]=0;
}

//the previous code given
//OnPlayerDeath
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);
}
I'm only not inserting indentation because I'm typing this into the post window and not in pawn, I can't hit TAB =(
Yeh I know, forums ruin indentationz, thanks for the help!!
Reply


Messages In This Thread
Textdraw - by Klutty - 21.06.2009, 19:43
Re: Textdraw - by Joe Staff - 21.06.2009, 19:54
Re: Textdraw - by Klutty - 21.06.2009, 20:10
Re: Textdraw - by Joe Staff - 21.06.2009, 20:25
Re: Textdraw - by Klutty - 21.06.2009, 20:29
Re: Textdraw - by Joe Staff - 21.06.2009, 20:34
Re: Textdraw - by Klutty - 21.06.2009, 20:37
Re: Textdraw - by Joe Staff - 21.06.2009, 20:40
Re: Textdraw - by Klutty - 21.06.2009, 20:44
Re: Textdraw - by Joe Staff - 21.06.2009, 21:15

Forum Jump:


Users browsing this thread: 1 Guest(s)