help with 4 warnings while doing deaths and kills td
#1

Код:
new Text:KILLS[MAX_PLAYERS]; 
new Text:DEATHS[MAX_PLAYERS];
OnPlayerConnect:

Код:
   
	KILLS[playerid] = TextDrawCreate(234.000000, 436.000000, "_");
	TextDrawBackgroundColor(KILLS[playerid], 43185919);
	TextDrawFont(KILLS[playerid], 3);
	TextDrawLetterSize(KILLS[playerid], 0.529999, 1.200000);
	TextDrawColor(KILLS[playerid], 255);
	TextDrawSetOutline(KILLS[playerid], 1);
	TextDrawSetProportional(KILLS[playerid], 1);

    
	DEATHS[playerid] = TextDrawCreate(330.000000, 437.000000, "_");
	TextDrawBackgroundColor(DEATHS[playerid], 43185919);
	TextDrawFont(DEATHS[playerid], 3);
	TextDrawLetterSize(DEATHS[playerid], 0.500000, 1.100000);
	TextDrawColor(DEATHS[playerid], 255);
	TextDrawSetOutline(DEATHS[playerid], 1);
	TextDrawSetProportional(DEATHS[playerid], 1);
Код:
public OnPlayerDeath(playerid,killerid,reason)
{
	KILLS[killerid]++;
	DEATHS[playerid]++;

	new iString[100];
	format(iString, sizeof iString, "Kills: %i", KILLS[playerid]);
	TextDrawSetString(KILLS[playerid], iString);
	
	format(iString, sizeof iString, "Kills: %i", KILLS[killerid]);
	TextDrawSetString(KILLS[killerid], iString);
	
	format(iString, sizeof iString, "Deaths: %i", DEATHS[playerid]);
	TextDrawSetString(DEATHS[playerid], iString);
	
	format(iString, sizeof iString, "Deaths: %i", DEATHS[killerid]);
	TextDrawSetString(DEATHS[killerid], iString);
	
    return 1;
}
Код:
C:\Users\Wallen\Desktop\SA-MP Projects\Zephy's project\SA-MP Server\gamemodes\DBv1.pwn(285) : warning 213: tag mismatch
C:\Users\Wallen\Desktop\SA-MP Projects\Zephy's project\SA-MP Server\gamemodes\DBv1.pwn(288) : warning 213: tag mismatch
C:\Users\Wallen\Desktop\SA-MP Projects\Zephy's project\SA-MP Server\gamemodes\DBv1.pwn(291) : warning 213: tag mismatch
C:\Users\Wallen\Desktop\SA-MP Projects\Zephy's project\SA-MP Server\gamemodes\DBv1.pwn(294) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Warnings.
Reply
#2

help o.o
Reply
#3

You must use different variables for the TextDraw and the user data, try this:

Код:
new Text:KILLS[MAX_PLAYERS];
new Text:DEATHS[MAX_PLAYERS];

new PlayerKills[MAX_PLAYERS];
new PlayerDeaths[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
	KILLS[playerid] = TextDrawCreate(234.000000, 436.000000, "_");
	TextDrawBackgroundColor(KILLS[playerid], 43185919);
	TextDrawFont(KILLS[playerid], 3);
	TextDrawLetterSize(KILLS[playerid], 0.529999, 1.200000);
	TextDrawColor(KILLS[playerid], 255);
	TextDrawSetOutline(KILLS[playerid], 1);
	TextDrawSetProportional(KILLS[playerid], 1);


	DEATHS[playerid] = TextDrawCreate(330.000000, 437.000000, "_");
	TextDrawBackgroundColor(DEATHS[playerid], 43185919);
	TextDrawFont(DEATHS[playerid], 3);
	TextDrawLetterSize(DEATHS[playerid], 0.500000, 1.100000);
	TextDrawColor(DEATHS[playerid], 255);
	TextDrawSetOutline(DEATHS[playerid], 1);
	TextDrawSetProportional(DEATHS[playerid], 1);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	TextDrawDestroy(KILLS[playerid]);
	TextDrawDestroy(DEATHS[playerid]);
	return 1;
}

public OnPlayerDeath(playerid,killerid,reason)
{
	PlayerKills[killerid]++;
	PlayerDeaths[playerid]++;

	new iString[100];

	format(iString, sizeof iString, "Kills: %i", PlayerKills[killerid]);
	TextDrawSetString(KILLS[killerid], iString);

	format(iString, sizeof iString, "Deaths: %i", PlayerDeaths[playerid]);
	TextDrawSetString(DEATHS[playerid], iString);
    return 1;
}
Reply
#4

Oh yeah, thanks! didn't tested yet ill tell you
Reply
#5

Works fine, thanks for your time.

PS: On my second account.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)