[Ajuda] comando errado
#1

pawn Код:
if(!strcmp(cmdtext,"/farol",true))
    {
        new mot, lu, alar, por, cap, porma, ob;
        new carro = GetPlayerVehicleID(playerid);
        if(GetPVarInt(playerid, "farol"))
        {
            {
                if(luz[playerid] == 1)
    {
    GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
    SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
    luz[playerid] = 0;
    SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!");
            }
        }
    }
        }
        SetPVarInt(playerid, "farol", false);
        {
        if(luz[playerid] == 0)
        {
        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
        SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
        luz[playerid] = 1;
        SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!");
                }
            }
        }
        return 1;
    }
o que tem de errado com esse comando ?
quando vou compila ele,o pawno para de funcionar.
Valeu ae.
Reply
#2

Tente:
pawn Код:
if(!strcmp(cmdtext,"/farol",true))
{
    new mot, lu, alar, por, cap, porma, ob;
    new carro = GetPlayerVehicleID(playerid);
    if(GetPVarInt(playerid, "farol"))
    {
        {
            if(luz[playerid] == 1)
            {
                GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
                luz[playerid] = 0;
                SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!");
                }
            }
        }
    }
    SetPVarInt(playerid, "farol", false);
    {
        if(luz[playerid] == 0)
        {
            GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
            SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
            luz[playerid] = 1;
            SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!");
        }
    }
    return 1;
}
Reply
#3

valeu por tentar ajudar.
mas deu a mesma coisa.
#Edit:nao sei se isso ajuda,mas o que eu quero fazer й juntar esse 2 comandos.
pawn Код:
if (strcmp("/farolon", cmdtext, true, 10) == 0)
    {
        new mot, lu, alar, por, cap, porma, ob;
        new carro = GetPlayerVehicleID(playerid);
        if(carro != INVALID_VEHICLE_ID)
            {
                if(luz[playerid] == 0)
                {
                    GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                    SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
                    luz[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!");
                }
            }
    }
    if (strcmp("/faroloff", cmdtext, true, 10) == 0)
    {
        new mot, lu, alar, por, cap, porma, ob;
        new carro = GetPlayerVehicleID(playerid);
        if(carro != INVALID_VEHICLE_ID)
            {
                if(luz[playerid] == 1)
                {
                    GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
                    SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
                    luz[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!");
                }
            }
    }
Reply
#4

pawn Код:
if(!strcmp(cmdtext,"/farol",true))
{
    new mot, lu, alar, por, cap, porma, ob;
    new carro = GetPlayerVehicleID(playerid);
    if(luz[playerid] == 1)
    {
        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
        SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
        luz[playerid] = 0;
        SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!");
    }
    else
    {
        GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
        SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
        luz[playerid] = 1;
        SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!");
    }
    return 1;
}
Reply
#5

o do vini deu certo,valeu,+rep pra vcs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)