PDA

View Full Version : Deathmatch Textdraw(kills,deaths,killingspree,ratio) "With update"!!! [Help]


Youtube12
30/11/2012, 10:58 AM
Example:

Kills:3
Deaths:1
Killingspree:2
Ratio:1.50

Here is the code, but its not updating.....

new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;


Textdraw0 = TextDrawCreate(391.176483, 319.416687, "Box");
TextDrawLetterSize(Textdraw0, 0.000000, 7.461111);
TextDrawTextSize(Textdraw0, 260.588226, 0.000000);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, 0);
TextDrawUseBox(Textdraw0, true);
TextDrawBoxColor(Textdraw0, 102);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 0);
TextDrawFont(Textdraw0, 0);

Textdraw1 = TextDrawCreate(265.882415, 317.333282, "Kills:");
TextDrawLetterSize(Textdraw1, 0.449999, 1.600000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, -1);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 1);
TextDrawBackgroundColor(Textdraw1, 51);
TextDrawFont(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);

Textdraw2 = TextDrawCreate(265.882293, 334.833312, "Deaths:");
TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, -1);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 1);

Textdraw3 = TextDrawCreate(265.411743, 350.583312, "Killingspree:");
TextDrawLetterSize(Textdraw3, 0.449999, 1.600000);
TextDrawAlignment(Textdraw3, 1);
TextDrawColor(Textdraw3, -1);
TextDrawSetShadow(Textdraw3, 0);
TextDrawSetOutline(Textdraw3, 1);
TextDrawBackgroundColor(Textdraw3, 51);
TextDrawFont(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);

Textdraw4 = TextDrawCreate(265.882354, 366.916778, "Ratio:");
TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
TextDrawAlignment(Textdraw4, 1);
TextDrawColor(Textdraw4, -1);
TextDrawSetShadow(Textdraw4, 0);
TextDrawSetOutline(Textdraw4, 1);
TextDrawBackgroundColor(Textdraw4, 51);
TextDrawFont(Textdraw4, 1);
TextDrawSetProportional(Textdraw4, 1);

[D]ry[D]esert
30/11/2012, 01:06 PM
Sure its not updating. because you have to update it using http://wiki.sa-mp.com/wiki/TextDrawSetString (http://http://wiki.sa-mp.com/wiki/TextDrawSetString)

ViniBorn
30/11/2012, 01:14 PM
You can use TextDrawShowForPlayer after TextDrawSetString

[D]ry[D]esert
30/11/2012, 01:25 PM
forexample

new TextDraw:pKills[MAX_PLAYERS];
new TextDraw:Deaths[MAX_PLAYERS];
new Kills[MAX_PLAYERS]; //at the top of your script.
new Deaths[MAX_PLAYERS] //at the top of your script too.
OnPlayerConnect(playerid)
{
pKills[playerid] = TextDrawCreate(265.882415, 317.333282, "Kills:");
TextDrawLetterSize(pKills[playerid], 0.449999, 1.600000);
TextDrawAlignment(pKills[playerid], 1);
TextDrawColor(pKills[playerid], -1);
TextDrawSetShadow(pKills[playerid], 0);
TextDrawSetOutline(pKills[playerid], 1);
TextDrawBackgroundColor(pKills[playerid], 51);
TextDrawFont(pKills[playerid], 1);
TextDrawSetProportional(pKills[playerid], 1);

pDeaths[playerid] = TextDrawCreate(265.882293, 334.833312, "Deaths:");
TextDrawLetterSize(pDeaths[playerid], 0.449999, 1.600000);
TextDrawAlignment(pDeaths[playerid], 1);
TextDrawColor(pDeaths[playerid], -1);
TextDrawSetShadow(pDeaths[playerid], 0);
TextDrawSetOutline(pDeaths[playerid], 1);
TextDrawBackgroundColor(pDeaths[playerid], 51);
TextDrawFont(pDeaths[playerid], 1);
TextDrawSetProportional(pDeaths[playerid], 1);
TextDrawShowForPlayer(playerid,pDeaths[playerid]);
TextDrawShowForPlayer(playerid,pKills[playerid]);
return 1;
}
OnPlayerDeath(playerid,killerid,reason)
{
new string[100];string2[100];
Kills[killerid] ++; // to increase killerid's kills.
Deaths[playerid] ++; //to increase playerid's deaths.
format(string,sizeof(string),"Kills:%d",Kills[killerid]);
format(string,sizeof(string2),"Deaths:%d",Deaths[playerid]);
TextDrawSetString(pKills[targetid], string);
TextDrawSetString(pDeaths[playerid], string2);
TextDrawShowForPlayer(playerid,pDeaths[playerid]);
TextDrawShowForPlayer(playerid,pKills[playerid]);
return 1;
}