[Ajuda] com o posto de gasolina!
#1

bom, toda vez que eu uso o comando /abastecer fala que nгo ta no posto, mais eu to !!

topo do gm :

pawn Код:
new Float:Texaco[3][3] =
{
    {2202.9646,2473.1289,10.4791},
    {1595.0642,2199.4622,10.4803},
    {2148.3413,2748.3240,10.8203}
};
no comando :

pawn Код:
command(abastecer, playerid, params[])
{
    if(GetPlayerState(playerid != PLAYER_STATE_DRIVER))
    return SendClientMessage(playerid, Cinza, "Vocк nгo estб em um carro ou nгo й o motorista");
    {
        for(new i; i != 3; ++i)
        if(!IsPlayerInRangeOfPoint(playerid, 6.0, Texaco[i][0], Texaco[i][1], Texaco[i][2]))
        return SendClientMessage(playerid, Azul, "Vocк nгo estб em um posto");
        {
           FuelTimer[playerid] = SetTimerEx("Abastecendo", 2500, true, "i", GetPlayerVehicleID(playerid), playerid);
        }
    }
    return 1;
}

pq isso
Reply
#2

Alguйm me ajuda pff !!
Reply
#3

pawn Код:
command(abastecer, playerid, params[])
{
    if(GetPlayerState(playerid != PLAYER_STATE_DRIVER))
    return SendClientMessage(playerid, Cinza, "Vocк nгo estб em um carro ou nгo й o motorista");
    {
        for(new i; i <= 3; ++i)
        {
            if(!IsPlayerInRangeOfPoint(playerid, 6.0, Texaco[i][0], Texaco[i][1], Texaco[i][2]))
                return SendClientMessage(playerid, Azul, "Vocк nгo estб em um posto");
           FuelTimer[playerid] = SetTimerEx("Abastecendo", 2500, true, "i", GetPlayerVehicleID(playerid), playerid);
        }
    }
    return 1;
}
Reply
#4

Porque vocк nгo deixou o cуdigo checar se o jogador estб no raio das posiзхes dos outros postos e jб deu return , o que fez finalizar o loop.

Sugiro que em vez de checar se ele nгo estб, cheque se ele estб, caso sim dк return 1; depois do timer e coloque essa mensagem de que ele nгo estб perto do posto depois do loop.
Reply
#5

Quote:
Originally Posted by Lucas-Fc
Посмотреть сообщение
bom, toda vez que eu uso o comando /abastecer fala que nгo ta no posto, mais eu to !!

topo do gm :

pawn Код:
new Float:Texaco[3][3] =
{
    {2202.9646,2473.1289,10.4791},
    {1595.0642,2199.4622,10.4803},
    {2148.3413,2748.3240,10.8203}
};
no comando :

pawn Код:
command(abastecer, playerid, params[])
{
    if(GetPlayerState(playerid != PLAYER_STATE_DRIVER))
    return SendClientMessage(playerid, Cinza, "Vocк nгo estб em um carro ou nгo й o motorista");
    {
        for(new i; i != 3; ++i)
        if(!IsPlayerInRangeOfPoint(playerid, 6.0, Texaco[i][0], Texaco[i][1], Texaco[i][2]))
        return SendClientMessage(playerid, Azul, "Vocк nгo estб em um posto");
        {
           FuelTimer[playerid] = SetTimerEx("Abastecendo", 2500, true, "i", GetPlayerVehicleID(playerid), playerid);
        }
    }
    return 1;
}

pq isso
Tente isso
pawn Код:
new Float:cordinatex,Float:cordinatey,Float:cordinatez;
new Float:Texaco[3][3] =
{
    {2202.9646,2473.1289,10.4791},
    {1595.0642,2199.4622,10.4803},
    {2148.3413,2748.3240,10.8203}
};

command(abastecer, playerid, params[])
{
    if(GetPlayerState(playerid != PLAYER_STATE_DRIVER))
    return SendClientMessage(playerid, Cinza, "Vocк nгo estб em um carro ou nгo й o motorista");
    {
        for(new i; i != 3; ++i)
        new rand = random(sizeof(Texaco));
        cordinatex = Texaco[rand][0];
        cordinatey = Texaco[rand][1];
        cordinatez = Texaco[rand][2];
        if(!IsPlayerInRangeOfPoint(playerid, 6.0, cordinatex,cordinatey,cordinatez))
        return SendClientMessage(playerid, Azul, "Vocк nгo estб em um posto");
        {
           FuelTimer[playerid] = SetTimerEx("Abastecendo", 2500, true, "i", GetPlayerVehicleID(playerid), playerid);
        }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Pocahontas
Посмотреть сообщение
pawn Код:
command(abastecer, playerid, params[])
{
    if(GetPlayerState(playerid != PLAYER_STATE_DRIVER))
    return SendClientMessage(playerid, Cinza, "Vocк nгo estб em um carro ou nгo й o motorista");
    {
        for(new i; i <= 3; ++i)
        {
            if(!IsPlayerInRangeOfPoint(playerid, 6.0, Texaco[i][0], Texaco[i][1], Texaco[i][2]))
                return SendClientMessage(playerid, Azul, "Vocк nгo estб em um posto");
           FuelTimer[playerid] = SetTimerEx("Abastecendo", 2500, true, "i", GetPlayerVehicleID(playerid), playerid);
        }
    }
    return 1;
}
nгo ajudou cara, continua a mesma coisa !
Reply
#7

pff alguйm me ajuda !!
Reply
#8

Tenta assim...
Topo da Gm
pawn Код:
enum PostoG
{
    Float:PostoX,
    Float:PostoY,
    Float:PostoZ
}
new Texaco[3][PostoG] = {
{2202.9646, 2473.1289, 10.4791},
{1595.0642, 2199.4622, 10.4803},
{2148.3413, 2748.3240, 10.8203}
};
Comando
pawn Код:
command(abastecer, playerid, params[])
{
    if(GetPlayerState(playerid != PLAYER_STATE_DRIVER))
    return SendClientMessage(playerid, Cinza, "Vocк nгo estб em um carro ou nгo й o motorista");
    {
        for(new i; i != 3; ++i)
        {
            if(IsPlayerInRangeOfPoint(playerid, 6.0, Texaco[i][PostoX], Texaco[i][PostoY], Texaco[i][PostoZ]))
            {
                FuelTimer[playerid] = SetTimerEx("Abastecendo", 2500, true, "i", GetPlayerVehicleID(playerid), playerid);
            }

        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)