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



Veiculos - leobpo - 02.03.2017

Na minha GM б um sistema de veiculos de casas e aluguel e tambйm de veiculos vips , o problema й que quando eu do /trancar que serve para abrir e fechar o carro , acabas nгo tendo efeito
PHP код:
if(strcmp(cmd"/trancar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
carid;
            if (
gTeam[playerid] == || gTeam[playerid] == 1)
            {
                if(
gLastCar[playerid] == && JogadorInfo[playerid][pPHousekey] == 999)
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo tem um carro de casa/alugado.");
                    return 
1;
                }
                else if(
gLastCar[playerid] != && 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(playeridCOLOR_GRAD2"Vocк nгo tem um carro.");
                    return 
1;
                }
            }
            
carid JogadorInfo[playerid][pPHousekey]+totalveiculosh;
            if(
HireCar[playerid] > && !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] == && JogadorInfo[playerid][pPHousekey] == 999)
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo tem um carro !");
                        return 
1;
                    }
                    if(
HireCar[playerid] == carid && !SwitchKey[playerid])
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo do Aluguel ~r~Fechado"25003);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 1;
                        
LockCar(carid);
                    }
                    else if(
JogadorInfo[playerid][pPHouseCarkey] == carid)
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo da casa ~r~Fechado"25003);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 1;
                        
LockCar(carid);
                        return 
1;
                    }
                }
                case 
1:
                {
                    if(
HireCar[playerid] == && JogadorInfo[playerid][pPHousekey] == 999)
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo tem um carro !");
                        return 
1;
                    }
                    if(
HireCar[playerid] == carid && !SwitchKey[playerid])
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo do aluguel ~g~Aberto"25003);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 0;
                        
UnLockCar(carid);
                        
SetPlayerVirtualWorld(playerid0);
                        
SetPlayerInterior(playerid0);
                    }
                    if (
JogadorInfo[playerid][pPHouseCarkey] == carid)
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo da casa ~g~Aberto"25003);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
gCarLock[carid] = 0;
                        
UnLockCar(carid);
                        
SetPlayerVirtualWorld(playerid0);
                        
SetPlayerInterior(playerid0);
                        return 
1;
                    }
                }
                default:
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Erro");
                }
            }
            if(
carid == 256)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo tem um carro!");
            }
        }
        return 
1;
    } 



Respuesta: Veiculos - Eiffel - 02.03.2017

Qualquer erro й sу adaptar com os veнculos da sua GameMode

PHP код:
if(strcmp(cmd"/trancar"true) == 0)
    {
            new 
carid;
            if(
gLastCar[playerid] == && PlayerInfo[playerid][pPHousekey] == 500)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo tem um carro de casa/alugado.");
                return 
true;
            }
            
carid PlayerInfo[playerid][pPHouseCarKey];
            if (
PlayerInfo[playerid][pPHousekey] == 500)
            {
                if(
HireCar[playerid] == 0)
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro.");
                    return 
true;
                }
            }
            if(
HireCar[playerid] > && !SwitchKey[playerid])
            {
                
carid HireCar[playerid];
            }
            new 
lockstatus VTrancado[carid];
            new 
Float:cx,Float:cy,Float:cz;
            
GetVehiclePos(caridcxcycz);
            switch (
lockstatus)
            {
                case 
0:
                {
                    if(
HireCar[playerid] == && PlayerInfo[playerid][pPHousekey] == 500)
                    {
                        
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;
                        
gCarLock[HireCar[playerid]] = 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] == 500)
                    {
                        
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);
                    }
                    if (
PlayerInfo[playerid][pPHouseCarKey] == carid)
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo da Casa ~g~Aberto"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
VTrancado[carid] = 0;
                        
UnLockCar(carid);
                        return 
true;
                    }
                }
                default:
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Erro");
                }
            }
            if(
carid == 256)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro!");
            }
            return 
true;
    } 



Re: Respuesta: Veiculos - leobpo - 02.03.2017

Quote:
Originally Posted by Eiffel
Посмотреть сообщение
Qualquer erro й sу adaptar com os veнculos da sua GameMode

PHP код:
if(strcmp(cmd"/trancar"true) == 0)
    {
            new 
carid;
            if(
gLastCar[playerid] == && PlayerInfo[playerid][pPHousekey] == 500)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Vocк nгo tem um carro de casa/alugado.");
                return 
true;
            }
            
carid PlayerInfo[playerid][pPHouseCarKey];
            if (
PlayerInfo[playerid][pPHousekey] == 500)
            {
                if(
HireCar[playerid] == 0)
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro.");
                    return 
true;
                }
            }
            if(
HireCar[playerid] > && !SwitchKey[playerid])
            {
                
carid HireCar[playerid];
            }
            new 
lockstatus VTrancado[carid];
            new 
Float:cx,Float:cy,Float:cz;
            
GetVehiclePos(caridcxcycz);
            switch (
lockstatus)
            {
                case 
0:
                {
                    if(
HireCar[playerid] == && PlayerInfo[playerid][pPHousekey] == 500)
                    {
                        
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;
                        
gCarLock[HireCar[playerid]] = 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] == 500)
                    {
                        
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);
                    }
                    if (
PlayerInfo[playerid][pPHouseCarKey] == carid)
                    {
                        
GameTextForPlayer(playerid"~w~Veiculo da Casa ~g~Aberto"50006);
                        
PlayerPlaySound(playerid11450.00.00.0);
                        
VTrancado[carid] = 0;
                        
UnLockCar(carid);
                        return 
true;
                    }
                }
                default:
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"Erro");
                }
            }
            if(
carid == 256)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Voce nгo tem um carro!");
            }
            return 
true;
    } 
D:\Pasta Samp\Downloads\Brasil Play Online\gamemodes\BPO.pwn(41199) : error 017: undefined symbol "pPHouseKey"
D:\Pasta Samp\Downloads\Brasil Play Online\gamemodes\BPO.pwn(41212) : error 017: undefined symbol "VTrancado"
D:\Pasta Samp\Downloads\Brasil Play Online\gamemodes\BPO.pwn(41212) : warning 215: expression has no effect
D:\Pasta Samp\Downloads\Brasil Play Online\gamemodes\BPO.pwn(41212) : error 001: expected token: ";", but found "]"
D:\Pasta Samp\Downloads\Brasil Play Online\gamemodes\BPO.pwn(41212) : error 029: invalid expression, assumed zero
D:\Pasta Samp\Downloads\Brasil Play Online\gamemodes\BPO.pwn(41212) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.


Re: Veiculos - Cheleber_Pausini - 02.03.2017

Mas fica sem efeito como?

1-O comando da erro ao ser executado?
2-As portas nгo trancam nem destrancam?

Se o problema for o 2 tente:
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
PHP код:
new enginelightsalarmdoorsbonnetbootobjective;
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
SetVehicleParamsEx(vehicleiddoorslightsalarmVEHICLE_PARAMS_ONbonnetbootobjective); //portas fechadas
SetVehicleParamsEx(vehicleiddoorslightsalarmVEHICLE_PARAMS_OFFbonnetbootobjective); //portas abertas. 



Respuesta: Veiculos - Eiffel - 02.03.2017

define os simbolos pPHouseKey e VTrancado em new lб no topo da GM, na linha 41212 onde ta o barra ] ou tira e adc o ; ou adiciona na frente, observa se a linha de cima ou debaixo tb tem o ( se o erro persistir me manda..