WHAT IS WRONG WITH THIS ATM? PLEASE HELP! -
buonggiorno - 02.12.2009
Hi here is code
Код:
//------------------------------------[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;
}
And here is problem...when i come to atm system and type /atmw ther is message YOU ARE NOT NEAR ATM...any problem?
Re: WHAT IS WRONG WITH THIS ATM? PLEASE HELP! -
MrPanz - 02.12.2009
Edit the playertopoint cordinates to where the ATM Object is?
Re: WHAT IS WRONG WITH THIS ATM? PLEASE HELP! -
buonggiorno - 02.12.2009
i do it but same thing NOT NERA ATM
Re: WHAT IS WRONG WITH THIS ATM? PLEASE HELP! -
[WF]Demon - 03.12.2009
Maybe do something like IsPlayerInArea ?
Re: WHAT IS WRONG WITH THIS ATM? PLEASE HELP! -
buonggiorno - 03.12.2009
no, its simpe, like you make parking bilbord
nothig special
))
but server dont show objects :S
Re: WHAT IS WRONG WITH THIS ATM? PLEASE HELP! -
bigcomfycouch - 03.12.2009
pawn Код:
if(strcmp(cmd, "/atmw", true, 5) == 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)) return SendClientMessage(playerid, COLOR_GREY, " Not near atm !");
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) return SendClientMessage(playerid, COLOR_GRAD2, " You havnt too much!");
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;
}
Note that I changed the || to &&. If you keep the checks as checking if they're not at pos1 OR pos2, they must be at both at the same time to execute the command.