[Ajuda] Ajuda com comando /motor
#1

Opб, queria saber porque esse cmd nгo funciona, quando digito ele aparece que ele nгo existe! Desde jб, agradeзo!

Код:
CMD:motor(vehicleid, playerid)
{
    if (!IsPlayerInVehicle(playerid))
    return SendClientMessage(playerid, COR_VERMELHO, "|ERRO| Vocк nгo estб em um veiculo!");
    SetVehicleParamsEx(vehicleid, 1, 0, 0, 0, 0, 0, 0);
    SendClientMessage(playerid, COR_CINZA, "|INFO| Veiculo ligado!");
    PlayerInfo[playerid][pLig] = 1;
    if (PlayerInfo[playerid][pLig] == 1)
    {
        SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0);
        SendClientMessage(playerid, COR_CINZA, "|INFO| Veiculo desligado!");
        return 1;
    }
    return 1;
}
Reply
#2

Seu servidor usa os comandos em strcmp?
Reply
#3

Quote:
Originally Posted by ipsLuan
Посмотреть сообщение
Seu servidor usa os comandos em strcmp?
Nгo, tudo em ZCMD
Reply
#4

Olб tudo bem, bom venho aqui lhe trazer dois comandos , o primeiro seria para ligar o motor caso esteja desligado , o segundo seria para desligar o motor caso esteja ligado, comandos sгo em CMD, rбpidos otimizados, espero que tenha lhe ajudado . Recomendo usar o IZCMD, apenas altere a include e trabalhe em mуdulos caso queira aprender , acesse esse link: https://sampforum.blast.hk/showthread.php?tid=620364



Upei o cуdigo no pastebin, para facilitar a vocк: https://pastebin.com/E5329Xu0
Reply
#5

Quote:
Originally Posted by DanielMatrix
Посмотреть сообщение
Olб tudo bem, bom venho aqui lhe trazer dois comandos , o primeiro seria para ligar o motor caso esteja desligado , o segundo seria para desligar o motor caso esteja ligado, comandos sгo em CMD, rбpidos otimizados, espero que tenha lhe ajudado . Recomendo usar o IZCMD, apenas altere a include e trabalhe em mуdulos caso queira aprender , acesse esse link: https://sampforum.blast.hk/showthread.php?tid=620364



Upei o cуdigo no pastebin, para facilitar a vocк: https://pastebin.com/RN68b4Sq
Eu quero saber oque estб de errado no cуdigo, e nгo um cуdigo pronto...
Reply
#6

o erro ta nessa linha

pawn Код:
CMD:motor(vehicleid, playerid)
tira esse vehicleid dai e poe playerid, params[]

depois pega o id do veiculo usando getplayervehicleid


tenho esse cуdigo aqui do meu gm, que liga e desliga o motor apertando N e farol apertando Y

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new id = GetPlayerVehicleID(playerid);

    if(newkeys & KEY_NO && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
        if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET) {
            SetVehicleParamsEx(id, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
//          SendClientMessage(playerid, Branco, "Vocк ligou o seu veнculo!");
        }
        else
        {
            SetVehicleParamsEx(id, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
//          SendClientMessage(playerid, Cinza, "Vocк desligou o seu veнculo!");
        }
    }
    if(newkeys & KEY_YES && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // Y
    {
        GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
        if(lights == VEHICLE_PARAMS_OFF || lights == VEHICLE_PARAMS_UNSET) {
            SetVehicleParamsEx(id, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
//          SendClientMessage(playerid, Branco, "Vocк ligou o farol do carro !");
        }
        else
        {
            SetVehicleParamsEx(id, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
//          SendClientMessage(playerid, Cinza, "Vocк desligou o farol do carro !");
        }
    }
/*
    new t[80];
    format(t, sizeof(t)," Tecla: %d", newkeys);
    SendClientMessage(playerid, -1, t);
*/

    return true;
}
Reply
#7

Quote:
Originally Posted by Lucas-Fc
Посмотреть сообщение
o erro ta nessa linha

pawn Код:
CMD:motor(vehicleid, playerid)
tira esse vehicleid dai e poe playerid, params[]

depois pega o id do veiculo usando getplayervehicleid


tenho esse cуdigo aqui do meu gm, que liga e desliga o motor apertando N e farol apertando Y

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new id = GetPlayerVehicleID(playerid);

    if(newkeys & KEY_NO && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
        if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET) {
            SetVehicleParamsEx(id, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
//          SendClientMessage(playerid, Branco, "Vocк ligou o seu veнculo!");
        }
        else
        {
            SetVehicleParamsEx(id, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
//          SendClientMessage(playerid, Cinza, "Vocк desligou o seu veнculo!");
        }
    }
    if(newkeys & KEY_YES && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // Y
    {
        GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
        if(lights == VEHICLE_PARAMS_OFF || lights == VEHICLE_PARAMS_UNSET) {
            SetVehicleParamsEx(id, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
//          SendClientMessage(playerid, Branco, "Vocк ligou o farol do carro !");
        }
        else
        {
            SetVehicleParamsEx(id, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
//          SendClientMessage(playerid, Cinza, "Vocк desligou o farol do carro !");
        }
    }
/*
    new t[80];
    format(t, sizeof(t)," Tecla: %d", newkeys);
    SendClientMessage(playerid, -1, t);
*/

    return true;
}
Ae agora sim, vlw men! +Rep pro cк
Reply
#8

de boa tmj
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)