SA-MP Forums Archive
[Ajuda] Sistema de ligar e desligar veiculos nao funfa - 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] Sistema de ligar e desligar veiculos nao funfa (/showthread.php?tid=391509)



Sistema de ligar e desligar veiculos nao funfa - Vinicius_TroLL - 10.11.2012

Tipo eu digito o comando e sу fala Veiculo ligado com sucesso ele nao desliga
pawn Код:
if (strcmp("/motor", cmdtext, true, 10) == 0)
{
    new carro = GetPlayerVehicleID(playerid);
    if(carro != INVALID_VEHICLE_ID)
    {
        if(Engine[playerid] == 0)
        {
            new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            Engine[Vehicle] = 1, SetVehicleParamsEx(Vehicle, 1, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, COLOR_GREEN, "Veiculo ligado com sucesso.");
           }
        else if(Engine[playerid] == 1)
          {
            new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, COLOR_GREEN, "Motor desligado com sucesso.");
            Engine[Vehicle] = 0, SetVehicleParamsEx(Vehicle, 0, lights, alarm, doors, bonnet, boot, objective);
        }
    }
}



Re: Sistema de ligar e desligar veiculos nao funfa - chelsao - 10.11.2012

pawn Код:
if (strcmp("/motor", cmdtext, true, 10) == 0)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid)
    {
        if(Engine[playerid] == 0)
        {
            vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            Engine[Vehicle] = 1, SetVehicleParamsEx(Vehicle, 1, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, COLOR_GREEN, "Veiculo ligado com sucesso.");
        }
        else if(Engine[playerid] == 1)
        {
            vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, COLOR_GREEN, "Motor desligado com sucesso.");
            Engine[Vehicle] = 0, SetVehicleParamsEx(Vehicle, 0, lights, alarm, doors, bonnet, boot, objective);
        }
    }
}



Re: Sistema de ligar e desligar veiculos nao funfa - Q.I - 10.11.2012

Quote:
Originally Posted by chelsao
Посмотреть сообщение
pawn Код:
if (strcmp("/motor", cmdtext, true, 10) == 0)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid)
    {
        if(Engine[playerid] == 0)
        {
            vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            Engine[Vehicle] = 1, SetVehicleParamsEx(Vehicle, 1, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, COLOR_GREEN, "Veiculo ligado com sucesso.");
        }
        else if(Engine[playerid] == 1)
        {
            vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(playerid, COLOR_GREEN, "Motor desligado com sucesso.");
            Engine[Vehicle] = 0, SetVehicleParamsEx(Vehicle, 0, lights, alarm, doors, bonnet, boot, objective);
        }
    }
}

muita gente nгo sabe mais eu repasso

pawn Код:
if (strcmp("/motor", cmdtext, true, 6 ) == 0) //quantos caracteres tem entre "" ? ae no caso sao 6 entгose coloca 6 aprendi isso usando dcmd



AW: Sistema de ligar e desligar veiculos nao funfa - Vinicius_TroLL - 11.11.2012

Tentei das duas maneiras e nгo funcionou


AW: Sistema de ligar e desligar veiculos nao funfa - Vinicius_TroLL - 11.11.2012

Deu esses erros
pawn Код:
(18114) : error 017: undefined symbol "engine"
(18114) : warning 215: expression has no effect
(18115) : error 017: undefined symbol "Vehicle"
(18116) : error 017: undefined symbol "Vehicle"
(18121) : error 017: undefined symbol "engine"
(18121) : warning 215: expression has no effect
(18122) : error 017: undefined symbol "Vehicle"
(18124) : error 017: undefined symbol "Vehicle"
Linhas
pawn Код:
vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            Engine[Vehicle] = 1, SetVehicleParamsEx(Vehicle, 1, lights, alarm, doors, bonnet, boot, objective);
            vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            Engine[Vehicle] = 0, SetVehicleParamsEx(Vehicle, 0, lights, alarm, doors, bonnet, boot, objective);