[Ajuda] Sistema de Roubar Carro
#1

Alguem me ajuda,
nao to conseguindo deixar o veiculo pra ficar aberto
exemplo
quero que quando o player der
/roubarcarro
o veiculo que estiver trancado
na frente dele
abre.
alguem ajuda

Cуdigo:

PHP код:
if(strcmp("/roubarcarro"cmdtexttrue) == 0)
{
    new 
carid;
    if(
IsPlayerInRangeOfPoint(playerid2.01193.1158,-1274.9397,13.5469))
    {
        if(
HireCar[playerid] == carid && !SwitchKey[playerid])
        {
            
GameTextForPlayer(playerid"Carro Roubado"50006);
            
PlayerPlaySound(playerid11450.00.00.0);
            
VTrancado[carid] = 0;
            
UnLockCar(carid);
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
        }
        new 
Float:XFloat:YFloat:Z;
        
GetPlayerPos(playeridXYZ);
        if(
>= -4000.00 && <= -944.00 && <= 2900.00 && >= -4000.00)
        {
            
SetPlayerCheckpoint(playerid, -2196.9966,-231.6548,35.1900,6.0); // San Fierro
            
roubado[playerid]=1;
            
SendClientMessage(playerid,verde"Vocк Acabou de Roubar um Veiculo, Level Ele Atй o Ponto Marcado no Mapa !");
            
SetPlayerCriminal(playerid,255"Roubo de Carro");
        }
        if(
>= -944.00 && <= 4000.00&& <= 2900.00 && >= 475.00)
        {
            
SetPlayerCheckpoint(playerid1052.8247,2192.0022,10.8203,6.0); // Las Venturas
            
roubado[playerid]=1;
            
SendClientMessage(playerid,verde"Vocк Acabou de Roubar um Veiculo, Level Ele Atй o Ponto Marcado no Mapa !");
            
SetPlayerCriminal(playerid,255"Roubo de Carro");
        }
        if(
>= -944.00 && <= 4000.00&& <= 475.00 && >= -4000.00)
        {
            
SetPlayerCheckpoint(playerid2695.9983,-2225.9236,13.5501,6.0); // Los Santos
            
roubado[playerid]=1;
            
SendClientMessage(playerid,verde"Vocк Acabou de Roubar um Veiculo, Level Ele Atй o Ponto Marcado no Mapa !");
            
SetPlayerCriminal(playerid,255"Roubo de Carro");
        }
        if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"Vc nгo esta em um veiculo");
        for(new 
i=0MAX_PLAYERS; ++i)
        {
            if(
== playerid) continue;
            
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
        }
        return 
1;
    }
    return 
0;

Reply
#2

pawn Код:
if(strcmp("/roubarcarro", cmdtext, true) == 0)
{
    new carid;
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1193.1158,-1274.9397,13.5469))
    {

        if(HireCar[playerid] == carid && !SwitchKey[playerid] && VTrancado[carid] == 1 ||)
        {
             GameTextForPlayer(playerid, "Carro Roubado", 5000, 6);
             PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
             VTrancado[carid] = 0;
             UnLockCar(carid);
             SetPlayerVirtualWorld(playerid, 0);
             SetPlayerInterior(playerid, 0);
        }

        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        if(X >= -4000.00 && X <= -944.00 && Y <= 2900.00 && Y >= -4000.00)
        {

            SetPlayerCheckpoint(playerid, -2196.9966,-231.6548,35.1900,6.0); // San Fierro
            roubado[playerid]=1;
            SendClientMessage(playerid,verde, "Vocк Acabou de Roubar um Veiculo, Level Ele Atй o Ponto Marcado no Mapa !");
            SetPlayerCriminal(playerid,255, "Roubo de Carro");
        }
        if(X >= -944.00 && X <= 4000.00&& Y <= 2900.00 && Y >= 475.00)
        {

            SetPlayerCheckpoint(playerid, 1052.8247,2192.0022,10.8203,6.0); // Las Venturas
            roubado[playerid]=1;
            SendClientMessage(playerid,verde, "Vocк Acabou de Roubar um Veiculo, Level Ele Atй o Ponto Marcado no Mapa !");
            SetPlayerCriminal(playerid,255, "Roubo de Carro");
        }
        if(X >= -944.00 && X <= 4000.00&& Y <= 475.00 && Y >= -4000.00)
        {

            SetPlayerCheckpoint(playerid, 2695.9983,-2225.9236,13.5501,6.0); // Los Santos
            roubado[playerid]=1;
            SendClientMessage(playerid,verde, "Vocк Acabou de Roubar um Veiculo, Level Ele Atй o Ponto Marcado no Mapa !");
            SetPlayerCriminal(playerid,255, "Roubo de Carro");
        }
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"Vc nгo esta em um veiculo");
        for(new i=0; i < MAX_PLAYERS; ++i)
        {

            if(i == playerid) continue;
            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
        }

        return 1;
    }
    return 0;
}
Testa assim
Reply
#3

Nem Funfo .-.
Reply
#4

if(HireCar[playerid] == carid && !SwitchKey[playerid] && VTrancado[carid] == 1)

muda isso eu pus uma coisa a mais pus o || a mais LOL esqueci-me de tirar
Reply
#5

ja tinha tirado ja
mais nem pego
Reply
#6

Mostra-me o Vtrancado sff
Reply
#7

Mostra oque?
Reply
#8

Tipo basicamente, tens a certeza que o VTrancado[carid] ta a funcionar bem? й pq se antes dava, mas agora, ele nao da e eu so mudei e adicionei o VTrancado[carid], provavelmente o bug estб no VTrancado[carid]

new carid = GetPlayerVehicleID(playerid);

Muda isso pelo teu new carid;
Reply
#9

Nem Funfo
Reply
#10

Quote:
Originally Posted by Humildade
Посмотреть сообщение
Nem Funfo
tu nao tens tipo um /carlock ou assim? se sim, posta aqui o comando, para eu ver uma cena
Reply
#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
#12

alguem .-. '-'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)