[Ajuda] Sistema de Roubar Carro
#11

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 
true;
                }
             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 
true;
                }
            }
            
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 
true;
                    }
                    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 
true;
                    }
                }
                case 
1:
                {
                    if(
HireCar[playerid] == && PlayerInfo[playerid][pPHousekey] == 255)
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro");
                        return 
true;
                    }
                    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 
true;
                    }
                }
                default:
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Erro");
                }
            }
            if(
carid == 256)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro!");
            }
        }
        return 
true;
    } 
Reply


Messages In This Thread
Sistema de Roubar Carro - by Humildade - 26.01.2013, 18:39
Re: Sistema de Roubar Carro - by taborda11 - 26.01.2013, 18:46
AW: Sistema de Roubar Carro - by Humildade - 26.01.2013, 18:50
Re: Sistema de Roubar Carro - by taborda11 - 26.01.2013, 18:52
AW: Sistema de Roubar Carro - by Humildade - 26.01.2013, 18:55
Re: Sistema de Roubar Carro - by taborda11 - 26.01.2013, 18:57
AW: Sistema de Roubar Carro - by Humildade - 26.01.2013, 19:01
Re: Sistema de Roubar Carro - by taborda11 - 26.01.2013, 19:09
AW: Sistema de Roubar Carro - by Humildade - 26.01.2013, 19:14
Re: AW: Sistema de Roubar Carro - by taborda11 - 26.01.2013, 19:27
AW: Sistema de Roubar Carro - by Humildade - 26.01.2013, 19:28
AW: Sistema de Roubar Carro - by Humildade - 26.01.2013, 22:21

Forum Jump:


Users browsing this thread: 2 Guest(s)