21.03.2013, 19:42
Now I thought I fixed the issue but it still happens can someone suggest a way to fix it.
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))
{
for(new h = 0; h < sizeof(Businesses); h++)
{
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)\nAvailable 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\nPress ~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\nAvailable 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\nPress ~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++)
{
format(string, sizeof(string), "~w~Group %s's HQ\nPress ~k~~PED_DUCK~ 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);
}
}
}
}
}
break;
}
return 1;
}