SA-MP Forums Archive
їDonde estб el problema? (Ya se que son las llaves.) - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: їDonde estб el problema? (Ya se que son las llaves.) (/showthread.php?tid=490664)



їDonde estб el problema? (Ya se que son las llaves.) - xHanks - 27.01.2014

Bueno, pues he estado creando un script pero como siempre digo, tengo un puto problema con las llaves, me funcionaba todo excepto cuando las cambiй.

pawn Код:
CMD:motor(playerid, params[])
{
new IDVEH = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
{
if(pInfo[playerid][pLlave1] == IDVEH)
{
if(Vehiculo[IDVEH][Motor] == 1)
{
Vehiculo[IDVEH][Motor]= 0;
GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(IDVEH, 0, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
SendClientMessage(playerid, -1, "Apagaste el motor. [Vehiculo SLOT 1]");
}
else if(Vehiculo[IDVEH][Motor] == 0)
{
Vehiculo[IDVEH][Motor] = 1;
GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(IDVEH, 1, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
SendClientMessage(playerid, -1, "Encendiste el motor.. [Vehiculo SLOT 1]");
}
}
else if(pInfo[playerid][pLlave2] == IDVEH)
   {
if(Vehiculo[IDVEH][Motor] == 1)
{
Vehiculo[IDVEH][Motor]= 0;
GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(IDVEH, 0, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
SendClientMessage(playerid, -1, "Apagaste el motor. [Vehiculo SLOT 2]");
}
else if(Vehiculo[IDVEH][Motor] == 0)
{
Vehiculo[IDVEH][Motor] = 1;
GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(IDVEH, 1, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
SendClientMessage(playerid, -1, "Encendiste el motor.. [Vehiculo SLOT 2]");
}
}
else if(pInfo[playerid][pLlave3] == IDVEH)
{
if(Vehiculo[IDVEH][Motor] == 1)
{
Vehiculo[IDVEH][Motor]= 0;
GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(IDVEH, 0, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
SendClientMessage(playerid, -1, "Apagaste el motor. [Vehiculo SLOT 3]");
}
else if(Vehiculo[IDVEH][Motor] == 0)
{
Vehiculo[IDVEH][Motor] = 1;
GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(IDVEH, 1, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
SendClientMessage(playerid, -1, "Encendiste el motor.. [Vehiculo SLOT 3]");
   }
   }
   }
   else
   {
   SendClientMessage(playerid,-1,"No tienes la llave del vehiculo. (Ni slot 1,2,3)");
   }
   return 1;
}



Re: їDonde estб el problema? (Ya se que son las llaves.) - Whyd - 27.01.2014

pawn Код:
CMD:motor(playerid, params[])
{
    new IDVEH = GetPlayerVehicleID(playerid);
    new engine, lights, alarm, doors, bonnet, boot, objective;
    if(pInfo[playerid][pLlave1] == IDVEH)
    {
        if(Vehiculo[IDVEH][Motor] == 1)
        {
            Vehiculo[IDVEH][Motor]= 0;
            GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(IDVEH, 0, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
            SendClientMessage(playerid, -1, "Apagaste el motor. [Vehiculo SLOT 1]");
        }
        else if(Vehiculo[IDVEH][Motor] == 0)
        {
            Vehiculo[IDVEH][Motor] = 1;
            GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(IDVEH, 1, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
            SendClientMessage(playerid, -1, "Encendiste el motor.. [Vehiculo SLOT 1]");
        }
    }
    else if(pInfo[playerid][pLlave2] == IDVEH)
    {
        if(Vehiculo[IDVEH][Motor] == 1)
        {
            Vehiculo[IDVEH][Motor]= 0;
            GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(IDVEH, 0, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
            SendClientMessage(playerid, -1, "Apagaste el motor. [Vehiculo SLOT 2]");
        }
        else if(Vehiculo[IDVEH][Motor] == 0)
        {
            Vehiculo[IDVEH][Motor] = 1;
            GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(IDVEH, 1, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
            SendClientMessage(playerid, -1, "Encendiste el motor.. [Vehiculo SLOT 2]");
        }
    }
    else if(pInfo[playerid][pLlave3] == IDVEH)
    {
        if(Vehiculo[IDVEH][Motor] == 1)
        {
            Vehiculo[IDVEH][Motor]= 0;
            GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(IDVEH, 0, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
            SendClientMessage(playerid, -1, "Apagaste el motor. [Vehiculo SLOT 3]");
        }
        else if(Vehiculo[IDVEH][Motor] == 0)
        {
            Vehiculo[IDVEH][Motor] = 1;
            GetVehicleParamsEx(IDVEH, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(IDVEH, 1, lights, alarm, doors, bonnet, boot, objective); // ONLY the engine param was changed (to 1)
            SendClientMessage(playerid, -1, "Encendiste el motor.. [Vehiculo SLOT 3]");
        }
    }
    else
    {
        SendClientMessage(playerid,-1,"No tienes la llave del vehiculo. (Ni slot 1,2,3)");
    }
    return 1;
}
Fнjate que pusiste { y } de mбs respecto al anterior cуdigo, la prуxima mira cuando abres y cierras la condiciуn.