Help with /rent cmd
#1

I'm kinda new at dcmd. Now I'm having a trouble over here. Maybe somebody can help me..


Код:
forward IsABike(carid);
Код:
public IsABike(carid)
{
  new Bikes[] = { 509, 510 , 481 };
  for(new i = 0; i < sizeof(Bikes); i++)
  {
    if(GetVehicleModel(carid) == Bikes[i]) return 1;
  }
  return 0;
}
pawn Код:
dcmd_rent(playerid, params[])
{
  #pragma unused params
 
  new vehicleId = GetPlayerVehicleID(playerid);
    if(gCar[vehicleId][Engine] == 1)
    {
      if IsABike(vehicleId)
      {//line 49418
            TogglePlayerControllable(playerid, false);
            gCar[vehicleId][Engine] = 0;
            SendClientMessage(playerid, COLOR_GREY, "You stopped renting a bike");
            Kinni[playerid] = 0;
            return 1;
        }
    }
    else
    {
      if Jalgratas(vehicleId)
      {//line 49429
            TogglePlayerControllable(playerid, true);
            SafeNewGivePlayerMoney(playerid, -100);
            gCar[vehicleId][Engine] = 1;
            SendClientMessage(playerid, COLOR_GREY, "You rented a bike !");
            Kinni[playerid] = 1;
            return 1;
         }
    }
    return 1;
}
And the error:

Код:
(49418) : error 001: expected token: "*then", but found "{"
(49429) : error 001: expected token: "*then", but found "{"
Reply
#2

which lines are the errors located?
Reply
#3

Ops, forgot that, edited my first post with lines and errors.
Reply
#4

You are missing ( after "if"
Reply
#5

hehe, that was it..It's late here, with sleepy head..it happens . Thanks :P
Reply
#6

No problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)