SA-MP Forums Archive
Ajuda ( Pedagio ) e.e - 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 ( Pedagio ) e.e (/showthread.php?tid=300829)



Ajuda ( Pedagio ) e.e - Baigou - 02.12.2011

Olб eu queria uma ajudinha aqui D: fazendo um enorme favor.

Й que quando eu passo em meu pedagio, ele fica cobrando atй eu sair do local. Alguem poderia me ajudar?


pawn Код:
public peda()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerInRangeOfPoint(i, 7.0,62.5154,-1533.2170,5.1818))
{
new string[50];
format(string, sizeof(string), "Pegбgio pago: 25 reais!");
GameTextForPlayer(i, string, 3000, 4);
GivePlayerMoneyEx(i,-25);
}
}
return 1;
}
Agradeзo.


Re: Ajuda ( Pedagio ) e.e - FreeGells - 02.12.2011

tente assim:

pawn Код:
new pedagio[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0,62.5154,-1533.2170,5.1818))
    {
        if(pedagio[playerid] == 0)
        {
            new string[50];
            format(string, sizeof(string), "Pegбgio pago: 25 reais!");
            GameTextForPlayer(playerid, string, 3000, 4);
            GivePlayerMoneyEx(playerid, -25);
            pedagio[playerid] = 1;
        }
    }
    else pedagio[playerid] = 0;
    return 1;
}



Re: Ajuda ( Pedagio ) e.e - |_MeGaTroN_| - 02.12.2011

Quote:
Originally Posted by FreeGells
Посмотреть сообщение
tente assim:

pawn Код:
new pedagio[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0,62.5154,-1533.2170,5.1818))
    {
        if(pedagio[playerid] == 0)
        {
            new string[50];
            format(string, sizeof(string), "Pegбgio pago: 25 reais!");
            GameTextForPlayer(playerid, string, 3000, 4);
            GivePlayerMoneyEx(playerid, -25);
            pedagio[playerid] = 1;
        }
    }
    else pedagio[playerid] = 0;
    return 1;
}
Quote:
Originally Posted by Mateuscm
Посмотреть сообщение
Eu acho melhor vc por em uma funcao por minuto, ou a cada segundo com um timer do que por no onplayerupdate... Imagina ter 100 playeronline e o onplayer update, que ocorre em media a cada 6 centesimos de segundap... Claro que vao causar lag pos verificaria constantemente o dinheiro do player... O onplayerupdate й chamado a cada mudanca minnuscula de posicao do player, a cada kill, a cada troca de arma, a cada ...
Espero que tenha entendido .


Re: Ajuda ( Pedagio ) e.e - dPlaYer_ - 02.12.2011

Quote:
Originally Posted by |_MeGaTroN_|
Посмотреть сообщение
Espero que tenha entendido .
[2]..


Re: Ajuda ( Pedagio ) e.e - |_MeGaTroN_| - 02.12.2011

Quote:
Originally Posted by [LF]PlaYer
Посмотреть сообщение
[2]..
\o/ by rjj -.-


Re: Ajuda ( Pedagio ) e.e - ViniBorn - 02.12.2011

pawn Код:
new PedagioPago[MAX_PLAYERS];
public peda()
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(PedagioPago[playerid] || !IsPlayerInAnyVehicle(playerid))
            continue;

        if(IsPlayerInRangeOfPoint(i, 7.0,62.5154,-1533.2170,5.1818))
        {
            GameTextForPlayer(i, "Pegбgio pago: 25 reais!", 3000, 4);
            GivePlayerMoneyEx(i,-25);
        }
    }
    return 1;
}
Olhe este tуpico


Re: Ajuda ( Pedagio ) e.e - $_Pooweer_$ - 02.12.2011

Ele sу pega os code e cola no GM.
Nгo adianta falar pra ele 'tentar' fazer algo, porque ele nem se quer vai ler #fikdik