їDonde estб el problema? (Ya se que son las llaves.)
#1

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;
}
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)