Rent System problems
#1

Код:
Код:
CMD:rentaj(playerid,params[])
{
   new string[128];
   if (GetPlayerMoney(playerid) <  150)//Ako igrac nema 150 $, nece moci da renta.
   {
      SendClientMessage(playerid, CRVENA, "Nemas dovoljno Novca!");
      return 1;
   }
   if(Rentano[playerid] != 299)//Proverava da li vec imas rentano vozilo.
   {
      SendClientMessage(playerid, SIVA, "Moras prvo da vratis iznajmljeno vozilo.");
      return 1;
   }
   for(new i=0; i<MAX_PLAYERS; i++)
   {
    if(Rentano<i> == GetPlayerVehicleID(playerid))//Ako je neko rentao vozilo, neces ga moci rentati
    {
       SendClientMessage(playerid, SIVA, "Neko je vec rentao ovo vozilo.");
       return 1;
    }
   }
      GivePlayerMoney(playerid,-150);//Oduzima igracu 150$
      Rentano[playerid] = GetPlayerVehicleID(playerid);//Postavlja igracu rent vozilo(da drugi nmg rentati)
      PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);// Pusta neke zvuke...
      format(string, sizeof(string), "~r~/unrentcar~n~~g~/lock.");//Tekst koji ce biti u GameTextu
      SendClientMessage(playerid, ZUTA, "Prijatan dan!");// ispisuje poruku igracu
      TogglePlayerControllable(playerid, 1);//Odmrzava igraca - Omogucava mu da se krece
      GameTextForPlayer(playerid, string, 5000, 3);// Prikazuje GameText
      return 1;
   }</i>
Error is :

C:\Users\Ewony\Desktop\New folder\gamemodes\PCRP.pwn(785) : error 028: invalid subscript (not an array or too many subscripts): "Rentano"
C:\Users\Ewony\Desktop\New folder\gamemodes\PCRP.pwn(785) : warning 215: expression has no effect
C:\Users\Ewony\Desktop\New folder\gamemodes\PCRP.pwn(785) : error 001: expected token: ";", but found "]"
C:\Users\Ewony\Desktop\New folder\gamemodes\PCRP.pwn(785) : error 029: invalid expression, assumed zero
C:\Users\Ewony\Desktop\New folder\gamemodes\PCRP.pwn(785) : fatal error 107: too many error messages on one line
Reply
#2

You are incorrectly accessing the array. Change this:

pawn Код:
if(Rentano<i> == GetPlayerVehicleID(playerid))
To this:

pawn Код:
if(Rentano[i] == GetPlayerVehicleID(playerid))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)