TEXTDRAW SHOW KILLS AND DEATHS HELP
#1

Hey guys I wanna make gamemode where on playerconnect textdraw shows but with amount of deaths and kills here is what I did :
Код:
public OnGameModeInit()
{
////////////////////////////////STATISTICS//////////////////////////////////////
	new kills;
	
	kills = PlayerInfo[playerid][Kills];
	
	Textdraw1 = TextDrawCreate(496.000000, 129.000000, "Deaths:");
	TextDrawBackgroundColor(Textdraw1, 255);
	TextDrawFont(Textdraw1, 1);
	TextDrawLetterSize(Textdraw1, 0.430000, 1.400000);
	TextDrawColor(Textdraw1, -1);
	TextDrawSetOutline(Textdraw1, 1);
	TextDrawSetProportional(Textdraw1, 1);

	Textdraw2 = TextDrawCreate(496.000000, 117.000000, "Kills:");
	TextDrawBackgroundColor(Textdraw2, 255);
	TextDrawFont(Textdraw2, 1);
	TextDrawLetterSize(Textdraw2, 0.509999, 1.400000);
	TextDrawColor(Textdraw2, -1);
	TextDrawSetOutline(Textdraw2, 1);
	TextDrawSetProportional(Textdraw2, 1);

	Textdraw3 = TextDrawCreate(557.000000, 118.000000, "10000");//DEATHS
	TextDrawBackgroundColor(Textdraw3, 255);
	TextDrawFont(Textdraw3, 3);
	TextDrawLetterSize(Textdraw3, 0.509999, 1.100000);
	TextDrawColor(Textdraw3, -1);
	TextDrawSetOutline(Textdraw3, 1);
	TextDrawSetProportional(Textdraw3, 1);

	Textdraw4 = TextDrawCreate(557.000000, 131.000000, "10000");//KILLS
	TextDrawBackgroundColor(Textdraw4, 255);
	TextDrawFont(Textdraw4, 3);
	TextDrawLetterSize(Textdraw4, 0.509999, 1.100000);
	TextDrawColor(Textdraw4, -1);
	TextDrawSetOutline(Textdraw4, 1);
	TextDrawSetProportional(Textdraw4, 1);
////////////////////////////////////////////////////////////////////////////////
Is this right?
Reply
#2

OnGameModeInit ??

kills = PlayerInfo[playerid][Kills];
Reply
#3

yes Is is wrong?
Reply
#4

No its not right vakhtang.

You do
pawn Код:
new kills = PlayerInfo[playerid][Kills];
when you want to use the function like during OnPlayerDeath.
Reply
#5

How should it work? help me
Reply
#6

pawn Код:
public OnPlayerDeath(playerid, killerid, reason
{
    SetPVarInt(playerid, "Deaths", GetPVarInt(playerid, "Deaths")+1);
    SetPVarInt(killerid, "Kills", GetPVarInt(killerid, "Kills")+1);
   
    new strdbe[20];
    format(strdbe, 20, "Kills: %d", GetPVarInt(killerid, "Kills"));
   
    TextDrawDestroy(Textdraw4); // destroys the current textdraw, can cause lagg if it doesn't get refreshed
   
    TextDrawSetString(strdbe, Textdraw4);
    TextDrawShowForPlayer(playerid, Textdraw4); // shows the new stats but this time with the new amount of kills
   
    format(strdbe, 20, "Deaths: %d", GetPVarInt(playerid, "Deaths"));
   
    TextDrawDestroy(Textdraw3); // destroys the current textdraw, can cause lagg if it doesn't get refreshed
   
    TextDrawSetString(strdbe, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw3); // shows the new stats but this time with the new amount of deaths
    return 1;
}
Try that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)