Quote:
Originally Posted by Konstantinos
Don't send the message that you're not in range in a loop because if you're not in range for the first item but you are for an item, it will send the message and stop.
PHP код:
CMD:pickup(playerid, params[])
{
new bool:inrange;
for(new i = 0; i < MAX_LABELS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, LabelInfo[i][LabelX], LabelInfo[i][LabelY], LabelInfo[i][LabelZ]))
{
format(GlobalString, sizeof(GlobalString), "%s picks up a weapon shell from the ground.", GetUsername(playerid));
ProxDetector(15.0, playerid, GlobalString, COLOR_PURPLE);
Delete3DTextLabel(Text3D:LabelInfo[i][LabelID]);
inrange = true;
break;
}
}
if (!inrange) SendClientMessage(playerid, COLOR_RED, "Error:"COL_WHITE" You're not near anything to pickup.");
return true;
}
|
Works, but sadly doesn't delete the label?