Need some help with windows command, It's prolly simple but i can't get it
#1

When i do /windows it rolls them down just fine, But when i do /windows again it rolls the windows down again, Why isn't it rolling them up like it's suppose to?

pawn Код:
if(!strcmp(cmd, "/windows", true) || !strcmp(cmd, "/wi", true))
        {
      if(IsPlayerConnected(playerid))
      {
        if(gPlayerLogged[playerid] == 0)
        {
          SendClientMessage(playerid, COLOR_GREY, " You need to login first ! ");
          return 1;
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
          if(VehicleWindows[GetPlayerVehicleID(playerid)] == 0)
              {
                  VehicleWindows[GetPlayerVehicleID(playerid)] = 1;
                       GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "***%s rolls down the window.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                ShowNameTags(true);
                return 1;
                }
                else if(VehicleWindows[GetPlayerVehicleID(playerid)] == 1)
                {
                VehicleWindows[GetPlayerVehicleID(playerid)] = 0;
                       GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, sizeof(string), "***%s rolls up the window.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                ShowNameTags(false);
                return 1;
                }
                return 1;
        }
        else
        {
          SendClientMessage(playerid, COLOR_GREY, "  You need to be in the vehicle to use this function !");
          return 1;
        }
      }
      return 1;
    }
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)