What's Wrong? [TextDraw]
#1

Hey guys, i have made a textdraw of players Kills: and Deaths: but when player ingame and another player joins, that player gets his or her stats instead of his own.

this is on playerspawn

PHP код:
        new Killtext[128];
        new 
Deathtext[128];
        
format(Killtextsizeof(Killtext), "Kills: %d"PlayerInfo[playerid][pKills]);
        
TextDrawSetString(TextdrawKillsKilltext);
        
format(Deathtextsizeof(Deathtext), "Deaths: %d"PlayerInfo[playerid][pDeaths]);
        
TextDrawSetString(TextdrawDeathsDeathtext); 
Reply
#2

That's because you've only got 2 textdraws being shared amongst all of your players.


You have to create a text for every player slot available.

pawn Код:
new Text:TextdrawKills[MAX_PLAYERS];

TextDrawSetString(TextdrawKills[playerid],Killtext);
Reply
#3

it gives me bunch of errors because i ahve TextdrawKills in ongamemode
Reply
#4

CTRL + H,
TextDrawKills
TextDrawKills [ playerid ]
Reply
#5

C:\Users\Andrew\Desktop\Los Santos Gang Wars\gamemodes\GangWars.pwn(245) : error 017: undefined symbol "TextDrawKills"
C:\Users\Andrew\Desktop\Los Santos Gang Wars\gamemodes\GangWars.pwn(245) : error 017: undefined symbol "playerid"
C:\Users\Andrew\Desktop\Los Santos Gang Wars\gamemodes\GangWars.pwn(245) : error 029: invalid expression, assumed zero
C:\Users\Andrew\Desktop\Los Santos Gang Wars\gamemodes\GangWars.pwn(245) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


This is ongamemode
Reply
#6

Create them at OnPlayerConnect
Reply
#7

C:\Users\Andrew\Desktop\Los Santos Gang Wars\gamemodes\GangWars.pwn(565) : error 017: undefined symbol "TextDrawKills"

TextDrawKills[playerid] = TextDrawCreate(546.000000, 40.000000, "Kills: 100");

this is the line..
Reply
#8

Comrade at that part you have to do a loop.

pawn Код:
for ( new i; i < MAX_PLAYERS; i ++ )
{
    TextDrawKills[i] = TextDrawCreate(546.000000, 40.000000, "Kills: 100");
    //OTHER SETTINGS HERE TOO
}
Reply
#9

same freakin error man, i placed it in ongamemode
Reply
#10

nvm i got it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)