SA-MP Forums Archive
What's Wrong? [TextDraw] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What's Wrong? [TextDraw] (/showthread.php?tid=202050)



What's Wrong? [TextDraw] - [Comrade] - 23.12.2010

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); 



Re: What's Wrong? [TextDraw] - Joe Staff - 23.12.2010

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);



Re: What's Wrong? [TextDraw] - [Comrade] - 23.12.2010

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


Re: What's Wrong? [TextDraw] - Retardedwolf - 23.12.2010

CTRL + H,
TextDrawKills
TextDrawKills [ playerid ]


Re: What's Wrong? [TextDraw] - [Comrade] - 23.12.2010

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


Re: What's Wrong? [TextDraw] - [L3th4l] - 23.12.2010

Create them at OnPlayerConnect


Re: What's Wrong? [TextDraw] - [Comrade] - 23.12.2010

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..


Re: What's Wrong? [TextDraw] - Retardedwolf - 23.12.2010

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
}



Re: What's Wrong? [TextDraw] - [Comrade] - 23.12.2010

same freakin error man, i placed it in ongamemode


Re: What's Wrong? [TextDraw] - [Comrade] - 23.12.2010

nvm i got it