PDA

View Full Version : Textdraw only gets showed to id 0?


thimo
08/01/2012, 05:29 PM
Fixed

Rob_Maate
08/01/2012, 05:31 PM
You've taken TextDrawShowForPlayer out of your loop. Put it inside the loop, and change playerid to i

thimo
08/01/2012, 05:36 PM
1 problem now it shows location names of id 0.... How to change that? :S

Rob_Maate
08/01/2012, 05:39 PM
I completely misread your first post...

Just explain again what you want your script to do?
If your looking for the location of one particular person, you don't need a loop

thimo
08/01/2012, 05:41 PM
I want it to show the location name for each player... And if i dont use the loop it doesnt show to Id 1 and higher anymore

Rob_Maate
08/01/2012, 05:45 PM
Right.

Firstly, in GlobalTimer, you need to change the "playerid"s to "a" within the loop.

Secondly, Where is your TextDrawShow code actually located? What public function?

thimo
08/01/2012, 05:46 PM
OnPlayerConnect(playerid) ...

Rob_Maate
08/01/2012, 05:54 PM
Scrap the loop.


TextDrawAlignment(APlayerData[playerid][Location], 2);
TextDrawBackgroundColor(APlayerData[playerid][Location], 255);
TextDrawFont(APlayerData[playerid][Location], 2);
TextDrawLetterSize(APlayerData[playerid][Location],0.280000, 1.100000);
TextDrawColor(APlayerData[playerid][Location], -1);
TextDrawSetOutline(APlayerData[playerid][Location], 1);
TextDrawSetProportional(APlayerData[playerid][Location], 1);
TextDrawShowForPlayer(playerid, APlayerData[playerid][Location]);


Change all i's to playerid's

Psymetrix
08/01/2012, 05:56 PM
Your using playerid within the loop. Change playerid to a.

GlobalTimer(playerid) should then be changed to GlobalTimer().

thimo
08/01/2012, 05:57 PM
I had that before rob but that didnt show above ID 0
~Edit: Its fixed i guess.. :)

Rob_Maate
08/01/2012, 05:59 PM
You didn't fix globaltimer mate.


public GlobalTimer()
{
for(new a = 0; a < MAX_PLAYERS; a++)
{
if(IsPlayerConnected(a))
{
//Location shower
new Zone[MAX_ZONE_NAME], string[128];
GetPlayer2DZone(a, Zone, MAX_ZONE_NAME);
format(string, sizeof(a), "%s", Zone);
TextDrawSetString(APlayerData[a][Location], string);
}
}
}

Rob_Maate
08/01/2012, 06:06 PM
nvm lol forum glitch