27.12.2013, 18:17
I have problem, with ATM loop. It should check, is PlayerIn near of any ATMs, but it always says, im not. I thought i should test break, because i read, that return stops loop, but i cant figure out, how to fix it.
pawn Код:
CMD:atm(playerid, params[])
{
for(new i = 1; i < MAX_ATMS; i++)
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0,aInfo[i][atmX],aInfo[i][atmY],aInfo[i][atmZ]))
{
SendClientMessage(playerid, COLOR_RED, "Sa pole ATMi lдhedal!");
break;
}
else
{
if(PlayerInfo[playerid][pAtmpass] == 0)
{
ShowPlayerDialog(playerid, 5518, DIALOG_STYLE_PASSWORD, "Bank Of America", "Vali endale sobiv parool, et endale pangakonto luua", "Loo", "Sulge");
}
else
{
ShowPlayerDialog(playerid,4329, DIALOG_STYLE_PASSWORD, "Bank Of America", "Sisesta oma salasхna, et sisse logida", ">>", "Katkesta");
}
}
}
return 1;
}