SA-MP Forums Archive
[Ajuda] Problemas com Keys - 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] Problemas com Keys (/showthread.php?tid=495694)



Problemas com Keys - VenoN - 18.02.2014

Estou a tentar criar uma especie de tecla para ligar um veiculo no servidor ..
o problema que a tecla que estou querendo usar й o 'SHIFT' or 'KEY_JUMP'
o problema й que aperto a tecla, e a funзгo nгo й chamada, mбs se eu apertar a tecla 'S' a funзгo й chamada
se alguem puder ajudar

Code:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new vehid = GetPlayerVehicleID(playerid);
        if(newkeys & KEY_JUMP)
        {
            new ST[7];
            GetVehicleParamsEx(vehid, ST[0], ST[1], ST[2], ST[3], ST[4], ST[5], ST[6]);
            SetVehicleParamsEx(vehid, VEHICLE_PARAMS_ON, ST[1], ST[2], ST[3], ST[4], ST[5], ST[6]);
        }
    }
    return 1;
}



Re: Problemas com Keys - Wanderson_SAMP - 18.02.2014

Vк ai, se der algum erro fala.

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
pawn Код:
if(PRESSED(KEY_JUMP))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new vehid = GetPlayerVehicleID(playerid);
            {
                new ST[7];
                GetVehicleParamsEx(vehid, ST[0], ST[1], ST[2], ST[3], ST[4], ST[5], ST[6]);
                SetVehicleParamsEx(vehid, VEHICLE_PARAMS_ON, ST[1], ST[2], ST[3], ST[4], ST[5], ST[6]);
             }
        }
        return 1;
    }



Re: Problemas com Keys - VenoN - 18.02.2014

nгo funcionou cara continua lingando com a tecla 'S' //

Mбs obrigado assim mesmo o que vale й a intenзгo


Re: Problemas com Keys - Wanderson_SAMP - 18.02.2014

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(newkeys & KEY_SECONDARY_ATTACK)
        {
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, 1);
        }
        if(Engine[vehicleid] == 0)
        {
            if(newkeys & KEY_JUMP)
            {
                SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
            }
        }
    }
    return 1;
}


Nгo vejo shift ai '-'


Re: Problemas com Keys - PT - 18.02.2014

https://sampwiki.blast.hk/wiki/Keys

Teclas possнveis tгo aн