SA-MP Forums Archive
[AJUDA]Veiculos Trancados - 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]Veiculos Trancados (/showthread.php?tid=262835)



[AJUDA]Veiculos Trancados - [Dk]TuReTOo - 19.06.2011

Boas eu criei estes veiculos e tipo entro no veiculo ando com ele depois ao sair ele feixa automaticamente :S depois tennho de fazer /trancar para ele destrancar e voltar a entrar depois saiio do veiculo e ele fica trancado novamente :S alguem me ajuda ? vejam os veiculos que meti que ficam trancados quando saio


PHP код:
    AddStaticVehicleEx(599,1240.75292969,464.20745850,19.82694435,331.25000000,4486, -1); //Police Ranger 44
    
AddStaticVehicleEx(596,1262.60827637,463.66604614,19.24835205,152.24853516,4486, -1); //Police Car (LSPD) 45
    
AddStaticVehicleEx(596,1259.61853027,465.31002808,19.24835205,152.24310303,4486, -1); //Police Car (LSPD) 46
    
AddStaticVehicleEx(599,1256.72607422,466.91308594,19.82694435,152.48773193,4486, -1); //Police Ranger 47
    
AddStaticVehicleEx(525,1253.69970703,468.49230957,19.29634857,151.98779297,4486, -1); //Police Car (LVPD) 48
    
AddStaticVehicleEx(525,1250.70092773,469.98507690,19.29634857,151.73779297,4486, -1); //Police Car (LVPD) 49
    
AddStaticVehicleEx(561,1234.99572754,477.83352661,19.82694435,59.24865723,4486, -1); //Stratum 50
    
AddStaticVehicleEx(579,1235.31835938,464.19494629,19.85291672,331.24877930,4486, -1); //Huntley 51 



Re: [AJUDA]Veiculos Trancados - DreeH - 19.06.2011

Mande seu Comando /trancar.


Re: [AJUDA]Veiculos Trancados - [Dk]TuReTOo - 19.06.2011

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_RED"   Vocк nгo tem um veнculo.");
                    return 
1;
                }
                else if(
gLastCar[playerid] != && 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(playeridCOLOR_RED"   Vocк nгo tem um veнculo.");
                    return 
1;
                }
            }
            
carid PlayerInfo[playerid][pPhousekey]+1;
            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(caridcxcycz);
            switch (
lockstatus)
            {
                case 
0:
                {
                    if(
HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
                    {
                        
SendClientMessage(playeridCOLOR_RED"   Vocк nгo tem um veнculo.");
                        return 
1;
                    }
                    if(
HireCar[playerid] == carid && !SwitchKey[playerid])
                    {
                        
GameTextForPlayer(playerid"~w~Veнculo ~r~Trancado"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 1;
                        
LockCar(carid);
                    }
                    else if (
PlayerInfo[playerid][pPhousekey] == carid-1)
                    {
                        
GameTextForPlayer(playerid"~w~Veнculos ~r~Trancados"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 1;
                        
LockCar(carid);
                        return 
1;
                    }
                }
                case 
1:
                {
                    if(
HireCar[playerid] == 299 && PlayerInfo[playerid][pPhousekey] == 255)
                    {
                        
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem um veнculo.");
                        return 
1;
                    }
                    if(
HireCar[playerid] == carid && !SwitchKey[playerid])
                    {
                        
GameTextForPlayer(playerid"~w~Veнculo ~g~Destrancado"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 0;
                        
UnLockCar(carid);
                    }
                    if (
PlayerInfo[playerid][pPhousekey] == carid-1)
                    {
                        
GameTextForPlayer(playerid"~w~Veнculos ~g~Destrancados"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 0;
                        
UnLockCar(carid);
                        return 
1;
                    }
                }
                default:
                {
                    
SendClientMessage(playeridCOLOR_RED" Erro");
                }
            }
            if(
carid == 256)
            {
                
SendClientMessage(playeridCOLOR_RED"   Vocк nгo tem um veнculo.");
            }
        }
        return 
1;
    }