[AJUDA]Spawnar carro com botao
#1

Ae galera queria tipo assim o cara aperta alt e spawna um elegy para ele
Sou novo em pawno e tal me ajudem ae por favor
Dou reputation pra quem ajudar
Reply
#2

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_WALK))
    {
                new Float:Pos[3];
                GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        CreateVehicle(562, Pos[0], Pos[1], Pos[2], 0.0, -1, -1, 15);
    }
    return 1;
}
Reply
#3

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_WALK))
    {
        new Float:X,Float:Y,Float:Z, Float:Angle;
        GetPlayerPos(playerid, X,Y,Z);
        GetPlayerFacingAngle(playerid, Angle);
        new veiculonovo = CreateVehicle(carrocriado, X,Y,Z, Angle, 0, 0, 60000);
        PutPlayerInVehicle(playerid, veiculonovo, 0);
    }
    return 1;
}
Tente assim!
Reply
#4

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_WALK)
    {
        new Float:wii[5];
        GetPlayerPos(playerid, wii[0], wii[1],wii[2]);
        GetPlayerFacingAngle(playerid, wii[3]);
        CreateVehicle(562, wii[0]+2,wii[1]+2,wii[2],wii[3],-1,-1,600000);
        return true;
    }
    return true;
}
Reply
#5

pawn Код:
#define Pressed(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (Pressed(KEY_WALK))
    {
        new Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        new VeiculoCreate = CreateVehicle(562, Pos[0], Pos[1], Pos[2], 0.0, -1, -1, 15);
        PutPlayerInVehicle(playerid, VeiculoCreate, 0);
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by |_MeGaTroN_|
Посмотреть сообщение
pawn Код:
#define Pressed(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (Pressed(KEY_WALK))
    {
        new Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        new VeiculoCreate = CreateVehicle(562, Pos[0], Pos[1], Pos[2], 0.0, -1, -1, 15);
        PutPlayerInVehicle(playerid, VeiculoCreate, 0);
    }
    return 1;
}
Agora ficou funcional. Mais porque pressed se ele quer apenas que aperte e o carro apareзa? (:
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)