SA-MP Forums Archive
[Ajuda] Carro Casa sempre aberto - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Carro Casa sempre aberto (/showthread.php?tid=285889)



[Ajuda] Carro Casa sempre aberto - wallacematheus - 25.09.2011

Bem todos os carros das casas estao abertos,e quando dou /trancar ele ele aprece trancado mais continua aberto queria que fechasse o carro e os carros ja ficassem trancados alguem?
acho q n й bug no cmd /trancar mais por via das duvida ta ae o cmd...

PHP код:
    if(strcmp(cmd"/trancar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
carid;
            if (
gTeam[playerid] == || gTeam[playerid] == 1)
            {
                if(
gLastCar[playerid] == && PlayerInfo[playerid][pPHousekey] == 255)
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo tem um carro de casa/alugado.");
                    return 
1;
                }
                else if(
gLastCar[playerid] != && gLastCar[playerid] != PlayerInfo[playerid][pPHousekey]+totalveiculos)
                {
                    if (
HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] > 0)
                    {
                        
gLastDriver[HireCar[playerid]] = 300;
                        
VTrancado[HireCar[playerid]] = 0;
                        
UnLockCar(HireCar[playerid]);
                    }
                    
HireCar[playerid] = gLastCar[playerid];
                }
            }
            if (
PlayerInfo[playerid][pPHousekey] == 255)
            {
                if(
HireCar[playerid] == 0)
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro.");
                    return 
1;
                }
            }
            
carid PlayerInfo[playerid][pPHousekey]+totalveiculosh;
            if(
HireCar[playerid] > && !SwitchKey[playerid])
            {
                
carid HireCar[playerid];
            }
            
//new driver = gLastDriver[carid];
            
new lockstatus VTrancado[carid];
            new 
Float:cx,Float:cy,Float:cz;
            
GetVehiclePos(caridcxcycz);
            switch (
lockstatus)
            {
                case 
0:
                {
                    if(
HireCar[playerid] == && PlayerInfo[playerid][pPHousekey] == 255)
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro");
                        return 
1;
                    }
                    if(
HireCar[playerid] == carid && !SwitchKey[playerid])
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo Alugado~r~Fechado"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
VTrancado[carid] = 1;
                        
LockCar(carid);
                    }
                    else if(
PlayerInfo[playerid][pPHouseCarkey] == carid)
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo da Casa ~r~Fechado"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
VTrancado[carid] = 1;
                        
LockCar(carid);
                        return 
1;
                    }
                }
                case 
1:
                {
                    if(
HireCar[playerid] == && PlayerInfo[playerid][pPHousekey] == 255)
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro");
                        return 
1;
                    }
                    if(
HireCar[playerid] == carid && !SwitchKey[playerid])
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo Alugado~g~Aberto"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
VTrancado[carid] = 0;
                        
UnLockCar(carid);
                        
SetPlayerVirtualWorld(playerid0);
                        
SetPlayerInterior(playerid0);
                    }
                    if (
PlayerInfo[playerid][pPHouseCarkey] == carid)
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo da Casa ~g~Aberto"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
VTrancado[carid] = 0;
                        
UnLockCar(carid);
                        
SetPlayerVirtualWorld(playerid0);
                        
SetPlayerInterior(playerid0);
                        return 
1;
                    }
                }
                default:
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Erro");
                }
            }
            if(
carid == 256)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro!");
            }
        }
        return 
1;
    } 
ah meu gm й upado do BMG


Re: [Ajuda] Carro Casa sempre aberto - Izaac Abreu - 25.09.2011

Mas e so com o carro da casa, ou o alugado, e os otros carros tipo da conce nao funfa?? Talvez pelo q vi pode ser algum erro na funзao LockCar(carid);
Voce mecheu utimamente no seu GM? talvez pode ter algo dando incompatibilidade. Voce usa godfather ne?

@edit. dei uma olhada. tente isso. Acho q esqeceu de uma variavel

Код:
	if(strcmp(cmd, "/trancar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new carid;
			if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
			{
				if(gLastCar[playerid] == 0 && PlayerInfo[playerid][pPhousekey] == 255)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem um Veнculo.");
					return 1;
				}
				else if(gLastCar[playerid] != 0 && gLastCar[playerid] != PlayerInfo[playerid][pPhousekey]+1)
				{
					if (HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] != 299)
					{
						gLastDriver[HireCar[playerid]] = 300;
						gCarLock[HireCar[playerid]] = 0;
						UnLockCar(HireCar[playerid]);
					}
					HireCar[playerid] = gLastCar[playerid];
				}
			}
			if (PlayerInfo[playerid][pPhousekey] == 255)
			{
				if(HireCar[playerid] == 299)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem um Veнculo.");
					return 1;
				}
			}
			carid = PlayerInfo[playerid][pPhousekey]+2;
			if(HireCar[playerid] != 299 && !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] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
					{
						SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem um Veнculo.");
						return 1;
					}
					if(HireCar[playerid] == carid && !SwitchKey[playerid])
					{
						GameTextForPlayer(playerid, "~w~veўculo ~r~trancado", 5000, 6);
						PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
						gCarLock[carid] = 1;
						LockCar(carid);
					}
					else if (PlayerInfo[playerid][pPhousekey] == carid-2)
					{
						GameTextForPlayer(playerid, "~w~veўculo ~r~trancado", 5000, 6);
						PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
						gCarLock[carid] = 1;
						LockCar(carid);
						return 1;
					}
				}
				case 1:
				{
					if(HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
					{
						SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem um Veнculo.");
						return 1;
					}
					if(HireCar[playerid] == carid && !SwitchKey[playerid])
					{
						GameTextForPlayer(playerid, "~w~veўculo ~g~destrancado", 5000, 6);
						PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
						gCarLock[carid] = 0;
						UnLockCar(carid);
					}
					if (PlayerInfo[playerid][pPhousekey] == carid-2)
					{
						GameTextForPlayer(playerid, "~w~veўculo ~g~destrancado", 5000, 6);
						PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
						gCarLock[carid] = 0;
						UnLockCar(carid);
						return 1;
					}
				}
				default:
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   Error");
				}
			}
			if(carid == 256)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "   Vocк nгo tem um Veнculo !");
			}
		}



Re: [Ajuda] Carro Casa sempre aberto - Pharrel - 25.09.2011

Quote:
Originally Posted by Izaac Abreu
Посмотреть сообщение
Mas e so com o carro da casa, ou o alugado, e os otros carros tipo da conce nao funfa?? Talvez pelo q vi pode ser algum erro na funзao LockCar(carid);
Voce mecheu utimamente no seu GM? talvez pode ter algo dando incompatibilidade. Voce usa godfather ne?
Nossa um interrogatorio antes de responder kkkk


Re: [Ajuda] Carro Casa sempre aberto - Izaac Abreu - 25.09.2011

So uma coisa pra dize pharrel;



E logico ne kkkkkkk eu nao tenho bola de cristal nao tio, e mais facil ele fala do q eu fica corrigindo tudo


Re: [Ajuda] Carro Casa sempre aberto - Pharrel - 25.09.2011

Mas й q eu fui lendo e rindo de tudo oq vc falou sу foram perguntas... o cara vai ler isso ai e pensar: hг?

ps sobre a img: o topico n й meu


Re: [Ajuda] Carro Casa sempre aberto - Izaac Abreu - 25.09.2011

Voce e o rex. Porra se ele nao sabe nem diser oq mais ta bugado se mata kkkkk

This forum requires that you wait 120 seconds between posts. Please try again in 30 seconds.
vai se fuder forum