[Ajuda] /trancar Bugado
#1

Boa Tarde pessoal, estou com um projeto de um GM RPG, e eu fiz o sistema de casas, e quando uso o comando /trancar, o carro continua trancado, ai eu uso /carrocasa e salvo as alteraзхes, cria outro veiculo por cima, e esse sim da para usar o comando /trancar, ai ele abre e fecha normal.
OBS: Jб usei o search, vi uns post, mas nenhum me ajudou.


Код HTML:
if(strcmp(cmd, "/trancar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new carid;
            if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
			{
				if(gLastCar[playerid] == 0 && JogadorInfo[playerid][pPHousekey] == 999)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um carro de casa/alugado.");
					return 1;
				}
				else if(gLastCar[playerid] != 0 && gLastCar[playerid] != JogadorInfo[playerid][pPHousekey]+totalveiculos)
				{
					if (HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] > 0)
					{
						gLastDriver[HireCar[playerid]] = 300;
						gCarLock[HireCar[playerid]] = 0;
						UnLockCar(HireCar[playerid]);
					}
					HireCar[playerid] = gLastCar[playerid];
				}
			}
			if (JogadorInfo[playerid][pPHousekey] == 999)
			{
				if(HireCar[playerid] == 0)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um carro.");
					return 1;
				}
			}
			carid = JogadorInfo[playerid][pPHousekey]+totalveiculosh;
			if(HireCar[playerid] > 0 && !SwitchKey[playerid])
			{
				carid = HireCar[playerid];
			}
			//new driver = gLastDriver[carid];
			new lockstatus = gCarLock[carid];
			new Float:cx,Float:cy,Float:cz;
			GetVehiclePos(carid, cx, cy, cz);
			switch (lockstatus)
			{
				case 0:
				{
					if(HireCar[playerid] == 0 && JogadorInfo[playerid][pPHousekey] == 999)
					{
						SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um carro !");
						return 1;
					}
					if(HireCar[playerid] == carid && !SwitchKey[playerid])
					{
						GameTextForPlayer(playerid, "~r~Veiculo do Aluguel ~r~Fechado", 2500, 3);
						PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
						gCarLock[carid] = 1;
						LockCar(carid);
					}
					else if(JogadorInfo[playerid][pPHouseCarkey] == carid)
					{
						GameTextForPlayer(playerid, "~r~Veiculo da casa ~r~Fechado", 2500, 3);
						PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
						gCarLock[carid] = 1;
						LockCar(carid);
						return 1;
					}
				}
				case 1:
				{
					if(HireCar[playerid] == 0 && JogadorInfo[playerid][pPHousekey] == 999)
					{
						SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um carro !");
						return 1;
					}
					if(HireCar[playerid] == carid && !SwitchKey[playerid])
					{
						GameTextForPlayer(playerid, "~r~Veiculo do aluguel ~g~Aberto", 2500, 3);
						PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
						gCarLock[carid] = 0;
						UnLockCar(carid);
						SetPlayerVirtualWorld(playerid, 0);
						SetPlayerInterior(playerid, 0);
					}
					if (JogadorInfo[playerid][pPHouseCarkey] == carid)
					{
						GameTextForPlayer(playerid, "~r~Veiculo da casa ~g~Aberto", 2500, 3);
						PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
						gCarLock[carid] = 0;
						UnLockCar(carid);
                        SetPlayerVirtualWorld(playerid, 0);
                        SetPlayerInterior(playerid, 0);
						return 1;
					}
				}
				default:
				{
					SendClientMessage(playerid, COLOR_GRAD2, "Erro");
				}
			}
			if(carid == 256)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um carro!");
			}
		}
		return 1;
	}
Reply


Messages In This Thread
/trancar Bugado - by Up - 25.01.2015, 20:29
Re: /trancar Bugado - by Up - 26.01.2015, 09:34
Re: /trancar Bugado - by AdesxXx - 26.01.2015, 13:42
Re: /trancar Bugado - by Up - 26.01.2015, 14:42
Re: /trancar Bugado - by Up - 27.01.2015, 09:30
Re: /trancar Bugado - by Up - 27.01.2015, 17:58
Re: /trancar Bugado - by Up - 28.01.2015, 14:19
Re: /trancar Bugado - by Up - 29.01.2015, 09:29
Re: /trancar Bugado - by VinnyScript - 29.01.2015, 14:51
Re: /trancar Bugado - by Up - 30.01.2015, 16:00

Forum Jump:


Users browsing this thread: 2 Guest(s)