for(new h = 0; h < sizeof(Businesses); h++)
{
if(GetPlayerVirtualWorld(i) == 0)
{
if(strcmp(Businesses[h][bOwner], "Nobody", true) == 0)
{
if(Businesses[h][bPrice] == -1)
{
format(string, sizeof(string), "Business %d (%s) Unavailable.", h, Businesses[h][bName]);
CreateDynamic3DTextLabel(string, YELLOW, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
else
{
format(string, sizeof(string), "Business %d (%s) Available to buy for %d (/buybusiness).", h, Businesses[h][bName], Businesses[h][bPrice]);
CreateDynamic3DTextLabel(string, YELLOW, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
}
else
{
format(string, sizeof(string), "Business %d (%s) Owner: %s. Press ~k~~PED_DUCK~ to enter", h, Businesses[h][bName], Businesses[h][bOwner]);
CreateDynamic3DTextLabel(string, YELLOW, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
}
GetPlayerVirtualWorld(i)
Can you show the outer loop* as well? It looks like you're creating a couple hundred labels in the same place.
* Judging by this: pawn Код:
|
public PickupMessages()
{
new string[128], Float: playX, Float: playY, Float: playZ;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerInRangeOfPoint(i, 9, playX, playY, playZ))
{
if(IsPlayerConnectedEx(i) && IsPlayerSpawned(i))
{
if(IsPlayerInRangeOfPoint(i, 5, ArrestPosX, ArrestPosY, ArrestPosZ))
{
GameTextForPlayer(i, "~r~Arrest ~w~Location", 3500, 3);
}
if(IsPlayerInRangeOfPoint(i, 5, 691.1537, -1275.7965, 13.5604))
{
GameTextForPlayer(i, "~y~V.I.P~w~ Club.", 3500, 3);
}
if(IsPlayerInRangeOfPoint(i, 2, 1158.1835, -1437.5432, 15.7981))
{
GameTextForPlayer(i, "~b~/~w~Buy.", 3500, 3);
}
for(new h = 0; h < sizeof(Businesses); h++)
{
if(GetPlayerVirtualWorld(i) == 0)
{
if(strcmp(Businesses[h][bOwner], "Nobody", true) == 0)
{
if(Businesses[h][bPrice] == -1)
{
format(string, sizeof(string), "Business %d (%s) Unavailable.", h, Businesses[h][bName]);
CreateDynamic3DTextLabel(string, YELLOW, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
else
{
format(string, sizeof(string), "Business %d (%s) Available to buy for %d (/buybusiness).", h, Businesses[h][bName], Businesses[h][bPrice]);
CreateDynamic3DTextLabel(string, YELLOW, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
}
else
{
format(string, sizeof(string), "Business %d (%s) Owner: %s. Press ~k~~PED_DUCK~ to enter", h, Businesses[h][bName], Businesses[h][bOwner]);
CreateDynamic3DTextLabel(string, YELLOW, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
}
}
for(new h = 0; h < sizeof(Houses); h++)
{
if(GetPlayerVirtualWorld(i) == 0)
{
if(strcmp(Houses[h][hOwner], "Nobody", true) == 0)
{
if(Houses[h][HousePrice] == -1)
{
format(string, sizeof(string), "House %d Unavailable.", h, Houses[h][HousePrice]);
CreateDynamic3DTextLabel(string, YELLOW, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
else
{
format(string, sizeof(string), "House %d Available to buy for %d (/buyhouse).", h, Houses[h][HousePrice]);
CreateDynamic3DTextLabel(string, YELLOW, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
}
else
{
format(string, sizeof(string), "House %d Owner: %s. Press ~k~~PED_DUCK~ to enter", h, Houses[h][hOwner]);
CreateDynamic3DTextLabel(string, YELLOW, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
}
}
for(new h = 0; h < sizeof(Jobs); h++)
{
if(IsPlayerInRangeOfPoint(i, 5, Jobs[h][JobJoinPosX], Jobs[h][JobJoinPosY], Jobs[h][JobJoinPosZ]))
{
if(GetPlayerVirtualWorld(i) == Jobs[h][JobJoinPosWorld] && GetPlayerInterior(i) == Jobs[h][JobJoinPosInterior])
{
format(string, sizeof(string), "~w~Job ~y~%s ~w~ ~n~ /joinjob", Jobs[h][JobName]);
GameTextForPlayer(i, string, 3500, 3);
}
}
if(IsPlayerInRangeOfPoint(i, 5, Jobs[h][JobMiscLocationOneX], Jobs[h][JobMiscLocationOneY], Jobs[h][JobMiscLocationOneZ]))
{
if(GetPlayerVirtualWorld(i) == Jobs[h][JobMiscLocationOneWorld] && GetPlayerInterior(i) == Jobs[h][JobMiscLocationOneInterior])
{
format(string, sizeof(string), "~w~ %s", Jobs[h][JobMiscLocationOneMessage]);
GameTextForPlayer(i, string, 3500, 3);
}
}
if(IsPlayerInRangeOfPoint(i, 5, Jobs[h][JobMiscLocationTwoX], Jobs[h][JobMiscLocationTwoY], Jobs[h][JobMiscLocationTwoZ]))
{
if(GetPlayerVirtualWorld(i) == Jobs[h][JobMiscLocationTwoWorld] && GetPlayerInterior(i) == Jobs[h][JobMiscLocationTwoInterior])
{
format(string, sizeof(string), "~w~ %s", Jobs[h][JobMiscLocationTwoMessage]);
GameTextForPlayer(i, string, 3500, 3);
}
}
}
for(new h = 0; h < sizeof(Groups); h++)
{
if(GetPlayerVirtualWorld(i) == 0)
{
format(string, sizeof(string), "~w~Group %s's HQ. Press ~k~~PED_DUCK~ ~w~ to enter", Groups[h][GroupName]);
CreateDynamic3DTextLabel(string, YELLOW, Groups[h][HQExteriorX], Groups[h][HQExteriorY], Groups[h][HQExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
}
if(IsPlayerInRangeOfPoint(i, 5, Groups[h][SafeX], Groups[h][SafeY], Groups[h][SafeZ]))
{
if(GetPlayerVirtualWorld(i) == Groups[h][SafeWorld])
{
format(string, sizeof(string), "~w~Group ~y~%s's ~w~ Safe.", Groups[h][GroupName]);
GameTextForPlayer(i, string, 3500, 3);
}
}
}
}
}
}
return 1;
}
Vince would be correct. It seems like you're creating 500 labels at a single position. After creating the label, you need to stop the loop. To do that, add this: break;
|
for(new h = 0; h < sizeof(Businesses); h++)
{
if(GetPlayerVirtualWorld(i) == 0)
{
if(strcmp(Businesses[h][bOwner], "Nobody", true) == 0)
{
if(Businesses[h][bPrice] == -1)
{
format(string, sizeof(string), "Business %d (%s) Unavailable.", h, Businesses[h][bName]);
CreateDynamic3DTextLabel(string, YELLOW, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
break;
}
else
{
format(string, sizeof(string), "Business %d (%s) Available to buy for %d (/buybusiness).", h, Businesses[h][bName], Businesses[h][bPrice]);
CreateDynamic3DTextLabel(string, YELLOW, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
break;
}
}
else
{
format(string, sizeof(string), "Business %d (%s) Owner: %s. Press ~k~~PED_DUCK~ to enter", h, Businesses[h][bName], Businesses[h][bOwner]);
CreateDynamic3DTextLabel(string, YELLOW, Businesses[h][bExteriorX], Businesses[h][bExteriorY], Businesses[h][bExteriorZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 5.0);
break;
}
}
}
}
break;
}
return 1;
}
Oh, my apologies!
Call "break;" after the "IsPlayerInRangeOfPoint" brace closes. So... pawn Код:
|
if(Businesses[h][bOwner][0] == '*')