Bankomati pomoc

Započeo LuKsA, Oktobar 11, 2009, 14:17:58 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

//------------------------------------[ATM SYSTEM]---------------------------------------------
    if(strcmp(cmd, "/atmwithdraw", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(!PlayerToPoint(2, playerid, 1367.109497, -1275.677490, 13.449019) || !PlayerToPoint(2, playerid, 2190.693604, -1133.222900, 25.050249)
               ||!PlayerToPoint(2, playerid, 477.471313, -1647.927246, 23.951000) || !PlayerToPoint(2, playerid, 267.889771, -1443.530884, 13.716413)
   ||!PlayerToPoint(2, playerid, 1724.893311, -1584.150391, 13.444713) || !PlayerToPoint(2, playerid, 1747.423950, -1863.297485, 13.477389)
   ||!PlayerToPoint(2, playerid, 2398.572266, -1914.977417, 13.449019) || !PlayerToPoint(2, playerid, 1956.180054, -2186.214600, 13.449019))
        {
            SendClientMessage(playerid, COLOR_GREY, "   Nisi kod Bankomata !");
            return 1;
        }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /atmwithdraw [kolicina]");
format(string, sizeof(string), "  Imas $%d na racunu.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /atmwithdraw [kolicina]");
format(string, sizeof(string), "  Imas $%d na racunu.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemas toliko novaca!");
return 1;
}
    ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), "  Uzeo si $%d sa svog racuna Ostalo: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
return 1;
}


ovo napravim, i kad dodem do tih kordinata, bankomata tog, kaze nisi kod bankomata.. zasto?
Aequam memento rebus in arduis servare mentem.

r4z0r

ta 2 u zagradi ispred playerid ti je radius .. 2 ti je premal , mjesto 2 stavi 5.0

Lakse ti je praviti takve vrste skripta ovako..:


Stavis forward..


forward IsAtBankomat(playerid);



Onda na kraj skripte stavi Public


public IsAtBankomat(playerid)
{
   if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(2.0,playerid,x,y,z) || PlayerToPoint(2.0,playerid,x,y,z))
{//12
   return 1;
}
else if(PlayerToPoint(2.0,playerid,x,y,z) || PlayerToPoint(2.0,playerid,x,y,z))
{//34
   return 1;
}
else if(PlayerToPoint(2.0,playerid,x,y,z) || PlayerToPoint(2.0,playerid,x,y,z))
{//56
   return 1;
}
else if(PlayerToPoint(2.0,playerid,x,y,z) || PlayerToPoint(2.0,playerid,x,y,z))
{//78
   return 1;
}

}
return 0;
}




Ovo x,y,z stavi svoje kordinate i kad pravis onakvu komandu samo stavi..


   if(strcmp(cmd, "/bwithdraw", true) == 0)
{
   if(IsPlayerConnected(playerid))
     {
                 if(IsAtBankomat(playerid))
             {
Poslednja Izmena: Oktobar 11, 2009, 15:30:30 POSLE PODNE od ░▒▓█►Juka◄█▓▒░

tnx a lot, puno ste pomogli  :D
Aequam memento rebus in arduis servare mentem.

Samo pojedinac koji nije upoznat sa optimizacijom memorije kakvu PAWNCC kompajler provodi ce staviti "public" umjesto "stock-a" gdje to nije potrebno + "stock" vrsta funkcije moze imati optimalni argument dok "public" to ne moze..