[Pomoc]bankomat

Započeo Retardinjo, April 08, 2011, 14:41:40 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim:Cyber
Detaljan opis problema:Ima jedan bug u skripti naime mogu deposit-at,withdraw-at,wiretransfer-at  od bilo kud...al neznam kako da rijesim taj problem da mogu dizat samo iz banke.
Dio skripte:/*------------------------------------------------------------------------------*/
if(strcmp(cmd, "/btransfer", true) == 0 || strcmp(cmd, "/bwiretransfer", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(PlayerInfo[playerid][pLevel] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Komanda: /btransfer [IgracevID/DeoImena] [Kolicina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Komanda: /btransfer [IgracevID/DeoImena] [Kolicina]");
return 1;
}
moneys = strvalEx(tmp);
if (IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), "   Prebacili ste $%d na %s-racun", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, SVETLOPLAVA, string);
format(string, sizeof(string), "   Primili ste $%d od %s", moneys, sendername, playerid);
SendClientMessage(giveplayerid, SVETLOPLAVA, string);
format(string, sizeof(string), "%s Prebacuje $%d na %s-racun", sendername, moneys, giveplayer);
                if(moneys >= 500000)
{
PorukaAdminima(ZUTA,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), "   %d je Offline !", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
/*------------------------------------------------------------------------------*/
    if(strcmp(cmd, "/withdraw", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
            tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /withdraw [Kolicina]");
format(string, sizeof(string), "  Imate $%d na racunu.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strvalEx(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /withdraw [Kolicina]");
format(string, sizeof(string), "  Imate $%d na racunu.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "Nemate toliko !");
return 1;
}
    ConsumingMoney[playerid] = 1;
JB_GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), "Podigli ste $%d sa racuna, Preostalo: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, ZUTA, string);
return 1;
}
return 1;
}
/*------------------------------------------------------------------------------*/
if(strcmp(cmd, "/deposit", true) == 0 || strcmp(cmd, "/depos", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /deposit [Kolicina]");
format(string, sizeof(string), "  Imate $%d na racunu.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strvalEx(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /deposit [Kolicina]");
format(string, sizeof(string), "  Imate $%d na racunu.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > JB_GetPlayerMoney(playerid) || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "Nemate toliko");
return 1;
}
JB_GivePlayerMoney(playerid,-cashdeposit);
new curfunds = PlayerInfo[playerid][pAccount];
PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
SendClientMessage(playerid, BELA, "|___ BANKOVNI RACUN ___|");
format(string, sizeof(string), "  Stari iznos: $%d", curfunds);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), "  Stavljeno na racun: $%d",cashdeposit);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
format(string, sizeof(string), "  Novi iznos: $%d", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, BELA, string);
return 1;
}
return 1;
}
/*------------------------------------------------------------------------------*/
if(strcmp(cmd, "/balance", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
format(string, sizeof(string), "  Imate $%d na racunu.",PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, ZUTA, string);
}
return 1;
}
/*------------------------------------------------------------------------------*/
if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "   Morate biti level 3 !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Komanda: /transfer [IgracevID/DioImena] [kolicina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Komanda: /transfer [IgracevID/DioImena] [kolicina]");
return 1;
}
moneys = strvalEx(tmp);
if (IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), "   Prebacili ste $%d na %s's racun", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), "   Dobili ste $%d na svom racunu, od %s", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s je prebacio $%d na %s", sendername, moneys, giveplayer);
                if(moneys >= 500000)
{
PorukaAdminima(ZUTA,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Netocna kolicina.");
}
}
}
else
{
format(string, sizeof(string), "   %d nije na serveru.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
/*------------------------------------------------------------------------------*/

Neke slike/video za lakse dobivanje pomoci(neobavezno):  //

poznaticovik

Ako u Cyberu ima "pLocal" probaj ovo dodat umjesto "pLevel"

        if(PlayerInfo[playerid][pLocal] != 103)
        {
            SendClientMessage(playerid, COLOR_GREY, "   You are not at the Bank !");
            return 1;
        }

kad stavim tu komandu onda nemogu od nikud dizat :SS

poznaticovik

Pa ne sve obrisati , samo ovo di ti je pLevel < 1 zamjeni sa mojim , ako neće neznam , probaj s PlayerToPoint šta ja znam xD


dragan12

Probaj dodati
if(IsPlayerInRangeOfPoint(playerid, 7.0, x,y,z))
Samo stavi svoje kordinate koje oces

Citat: Gagi_Corleone poslato April 08, 2011, 17:10:17 POSLE PODNE
Probaj dodati
if(IsPlayerInRangeOfPoint(playerid, 7.0, x,y,z))
Samo stavi svoje kordinate koje oces
Nisi rekao gde,

Btw .
/*------------------------------------------------------------------------------*/
if(strcmp(cmd, "/btransfer", true) == 0 || strcmp(cmd, "/bwiretransfer", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
             if(IsPlayerInRangeOfPoint(playerid, 7.0, x,y,z))
                       {
if(PlayerInfo[playerid][pLevel] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Komanda: /btransfer [IgracevID/DeoImena] [Kolicina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Komanda: /btransfer [IgracevID/DeoImena] [Kolicina]");
return 1;
}
moneys = strvalEx(tmp);
if (IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), "   Prebacili ste $%d na %s-racun", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, SVETLOPLAVA, string);
format(string, sizeof(string), "   Primili ste $%d od %s", moneys, sendername, playerid);
SendClientMessage(giveplayerid, SVETLOPLAVA, string);
format(string, sizeof(string), "%s Prebacuje $%d na %s-racun", sendername, moneys, giveplayer);
                if(moneys >= 500000)
{
PorukaAdminima(ZUTA,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Invalid transaction amount.");
}
}
}
                        }
else
{
format(string, sizeof(string), "   %d je Offline !", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}


tako dodaj i na ostalim,
if(IsPlayerInRangeOfPoint(playerid, 7.0, x,y,z))
{



ispod
if(IsPlayerConnected(playerid))
    {



i onda dodas tamo negde pri kraju kao sto sam i ja jos jednu }



fala vam ljudi oboje ste mi pomogli

EDIT:
imam jos jedno pitanje :D
kako da stavim da kaze da nisam blizu banke?? probo sam sa onim od mata al neide :(
Poslednja Izmena: April 08, 2011, 17:48:55 POSLE PODNE od Gangasta300

dragan12

Ispod ovog:
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Invalid transaction amount.");
}
}

Dodaj ovo tako bi trebalo
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Niste u banci.");
}
}

Citat: Gagi_Corleone poslato April 08, 2011, 19:04:09 POSLE PODNE
Ispod ovog:
}
else
{
[b]SendClientMessage(playerid, COLOR_GRAD1, "Invalid transaction amount.");[/b]
}
}


za sto je ovo?

dragan12

Citat: Gangasta300 poslato April 08, 2011, 19:09:32 POSLE PODNE
Citat: Gagi_Corleone poslato April 08, 2011, 19:04:09 POSLE PODNE
Ispod ovog:
}
else
{
[b]SendClientMessage(playerid, COLOR_GRAD1, "Invalid transaction amount.");[/b]
}
}


za sto je ovo?
/*------------------------------------------------------------------------------*/
if(strcmp(cmd, "/btransfer", true) == 0 || strcmp(cmd, "/bwiretransfer", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
             if(IsPlayerInRangeOfPoint(playerid, 7.0, x,y,z))
                       {
if(PlayerInfo[playerid][pLevel] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Komanda: /btransfer [IgracevID/DeoImena] [Kolicina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Komanda: /btransfer [IgracevID/DeoImena] [Kolicina]");
return 1;
}
moneys = strvalEx(tmp);
if (IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), "   Prebacili ste $%d na %s-racun", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, SVETLOPLAVA, string);
format(string, sizeof(string), "   Primili ste $%d od %s", moneys, sendername, playerid);
SendClientMessage(giveplayerid, SVETLOPLAVA, string);
format(string, sizeof(string), "%s Prebacuje $%d na %s-racun", sendername, moneys, giveplayer);
                if(moneys >= 500000)
{
PorukaAdminima(ZUTA,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Invalid transaction amount.");
}
}
}
                        }
else
{
format(string, sizeof(string), "   %d je Offline !", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}