02.12.2009, 17:42
Hi here is code
And here is problem...when i come to atm system and type /atmw ther is message YOU ARE NOT NEAR ATM...any problem?
Код:
//------------------------------------[ATM SYSTEM]---------------------------------------------
if(strcmp(cmd, "/atmw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!PlayerToPoint(5, playerid, 1836.257,-1692.148,13.016) || !PlayerToPoint(5, playerid, 484.380,-1462.363,18.127)
||!PlayerToPoint(5, playerid, 1498.445,-1748.956,15.106,78) || !PlayerToPoint(5, playerid, 1940.843,-2123.240,13.218)
||!PlayerToPoint(5, playerid, 1211.258,-914.979,42.682))
{
SendClientMessage(playerid, COLOR_GREY, " Not near atm !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Use: /atmw [kolicina]");
format(string, sizeof(string), " you have $%d on account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Use: /atmw [kolicina]");
format(string, sizeof(string), " you have $%d on account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You havnt too much!");
return 1;
}
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), " You take $%d from account, left: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
return 1;
}


nothig special