[Pomoc] /rentbike

Započeo [A]hidroKrilac, Jun 28, 2011, 20:46:53 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim: Ravens
Detaljan opis problema: Pomogao mi je drug nesto oko /rentbike komande i sada posto imam 2 biza renta imam i ono else if u komandi a promenio sam da vozila registruje tj ono da se definisu koja su za rent da bude  evo komande pa cu pored onoga sto me zanima staviti // pa neki tekst
Dio skripte: f(strcmp(cmd, "/rentbike", true) == 0)
   {
        if(IsPlayerConnected(playerid))
  {
            for(new i = 0; i < sizeof(rentbike); i++)
   {
            new hirefee = HireCost(GetPlayerVehicleID(playerid));
            if(SBizzInfo[0][sbProducts] == 1)
            {
               GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
               return 1;
            }
            /*if(PlayerInfo[playerid][pPbiskey] == 0)
            {
               GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
               TogglePlayerControllable(playerid, 1);
               return 1;
            }*/
            if (GetPlayerMoney(playerid) <  SBizzInfo[0][sbEntranceCost])
            {
               SendClientMessage(playerid, COLOR_GRAD2, "   You dont have that much cash !");
               return 1;
            }
            if(HireCar[playerid] != 299)
            {
               gCarLock[HireCar[playerid]] = 0;
               UnLockCar(HireCar[playerid]);
               SendClientMessage(playerid, COLOR_GREY, "You need unrent your current car/bike/boat first !");
               return 1;
            }
            for(new i=0; i<MAX_PLAYERS; i++)
            {
                if(HireCar[i] == GetPlayerVehicleID(playerid))
                {
                    SendClientMessage(playerid, COLOR_GREY, "    Someone already rents this car !");
                    return 1;
                }
            }
            SafeGivePlayerMoney(playerid,-SBizzInfo[0][sbEntranceCost]);
            SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
            ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
            SBizzInfo[0][sbProducts]--;
            HireCar[playerid] = GetPlayerVehicleID(playerid);
            OnPropUpdate(3,0);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            format(string, sizeof(string), "~w~Don't forget to ~b~/unrentbike~n~~g~/lock ~w~to lock your bike",hirefee);
            TogglePlayerControllable(playerid, 1);
            gEngine[GetPlayerVehicleID(playerid)] = 1;
            GameTextForPlayer(playerid, string, 5000, 3);

            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /rentbike",d,m,y,h,mi,s,sendername);
            CommandLog(string);
         }
         else if(GetPlayerVehicleID(playerid) >= 192 && GetPlayerVehicleID(playerid) <= 101) // ovde mi prijavljuje error...ne mogu da resim a i gore mi nije jasno kako ce da prepozna koja su vozila za 1 rent a koja za drugi :S
         {
            new hirefee = HireCost(GetPlayerVehicleID(playerid));
            if(SBizzInfo[16][sbProducts] == 1)
            {
               GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
               return 1;
            }
            /*if(PlayerInfo[playerid][pPbiskey] == 0)
            {
               GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
               TogglePlayerControllable(playerid, 1);
               return 1;
            }*/
            if (GetPlayerMoney(playerid) <  SBizzInfo[16][sbEntranceCost])
            {
               SendClientMessage(playerid, COLOR_GRAD2, "   You dont have that much cash !");
               return 1;
            }
            if(HireCar[playerid] != 299)
            {
               gCarLock[HireCar[playerid]] = 0;
               UnLockCar(HireCar[playerid]);
               SendClientMessage(playerid, COLOR_GREY, "You need unrent your current car/bike/boat first !");
               return 1;
            }
            for(new i=0; i<MAX_PLAYERS; i++)
            {
                if(HireCar[i] == GetPlayerVehicleID(playerid))
                {
                    SendClientMessage(playerid, COLOR_GREY, "    Someone already rents this car !");
                    return 1;
                }
            }
            SafeGivePlayerMoney(playerid,-SBizzInfo[16][sbEntranceCost]);
            SBizzInfo[16][sbTill] += SBizzInfo[16][sbEntranceCost];
            ExtortionSBiz(0, SBizzInfo[16][sbEntranceCost]);
            SBizzInfo[16][sbProducts]--;
            HireCar[playerid] = GetPlayerVehicleID(playerid);
            OnPropUpdate(3,0);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            format(string, sizeof(string), "~w~Ne zaboravi ~b~/unrentbike~n~~g~/lock ~w~to lock your bike",hirefee);
            TogglePlayerControllable(playerid, 1);
            gEngine[GetPlayerVehicleID(playerid)] = 1;
            GameTextForPlayer(playerid, string, 5000, 3);

            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /rentbike",d,m,y,h,mi,s,sendername);
            CommandLog(string);
         }
      }
return 1;
}

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

if(strcmp(cmd, "/rentabike", true) == 0)
{
        if(IsPlayerConnected(playerid))
{
if(GetPlayerVehicleID(playerid) >= 331 && GetPlayerVehicleID(playerid) <= 344)
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(GetPlayerVehicleID(playerid) >= 72 && GetPlayerVehicleID(playerid) <= 77)
{
if(SBizzInfo[0][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Rasprodan", 5000, 1);
return 1;
}
if(PlayerInfo[playerid][pPbiskey] == 0)
{
GameTextForPlayer(playerid, "~w~Nema zadužen za gazda", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}
if (GetPlayerMoney(playerid) <  SBizzInfo[0][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate toliko novaca !");
return 1;
}
GivePlayerMoney(playerid,-SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbProducts]--;
}
if(GetPlayerVehicleID(playerid) >= 75 && GetPlayerVehicleID(playerid) <= 77)
{
if(SBizzInfo[1][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Rasprodan", 5000, 1);
return 1;
}
if(PlayerInfo[playerid][pPbiskey] == 1)
{
GameTextForPlayer(playerid, "~w~Nema zadužen za gazda", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}
if (GetPlayerMoney(playerid) <  SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate toliko novaca !");
return 1;
}
GivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
}
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Nadamo se da cete uzivati ~n~koristeci ovaj motor~n~Za zakljucati motor pisite~n~type ~g~/lock~n~~w~molimo vozite sigurno.",hirefee);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
}
}
return 1;
}


Ovakvo je kod mene

resio sam..uradio sma drugacije...hvala moze lock :)
//