SA-MP Forums Archive
[Ajuda] Flood no carregar.... - 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] Flood no carregar.... (/showthread.php?tid=436329)



Flood no carregar.... - Cromado - 11.05.2013

Olб galera aquele sistema que eu pedi ajuda de carregar ta funfando, bom agora ele ta floodando o chat sem parar e eu nгo sei como faz parar
ta ai o print

eo comando obvio
pawn Код:
SetTimer("checkTrailer", 1000, 1);
forward checkTrailer(playerid);
public checkTrailer(playerid) {
if(GetVehicleTrailer(GetPlayerVehicleID(playerid)))
 SendClientMessage(playerid, 0xFFFFFFAA, "[ INFO ] Seu caminhгo estб carregado com petroleo leve-o atй um posto!.");
    if (PlayerToPoint(60.0, playerid, 269.9238,1351.9838,10.5859))
    AttachTrailerToVehicle(5, 1);
    if(IsTrailerAttachedToVehicle(584))
{
    SendClientMessage(playerid, 0x008000FF, "[ INFO ] Seu caminhгo estб carregado com petroleo leve-o atй um posto!");
}
return 1;
}]
alguem ai me ajuda?


Re: Flood no carregar.... - ProKillerpa - 11.05.2013

Que cуdigo й esse amigo?
Tenta aн
pawn Код:
//Ongamemodeinit
SetTimer("checkTrailer", 1000, 1);

//TOPO
forward checkTrailer(playerid);

//FINAL
public checkTrailer(playerid) {
    if(GetVehicleTrailer(GetPlayerVehicleID( playerid )))
    SendClientMessage(playerid, 0xFFFFFFAA, "[ INFO ] Seu caminhгo estб carregado com petroleo leve-o atй um posto!.");
    if (PlayerToPoint(60.0, playerid, 269.9238,1351.9838,10.5859))
    AttachTrailerToVehicle(5, 1);
    return 1;
}



Re: Flood no carregar.... - Cromado - 11.05.2013

esse codigo e tipo um que eu ponhei pra carregar altomaticamente man
ainda ta do msm geito + auguem pra me ajudar


Re: Flood no carregar.... - ProKillerpa - 11.05.2013

Sabe porque estб floodando?

pawn Код:
{
    SendClientMessage(playerid, 0x008000FF, "[ INFO ] Seu caminhгo estб carregado com petroleo leve-o atй um posto!");
}
Ele estб verificando se o seu caminhгo tem a carga X, se tiver ele manda essa mensagem.
Tente colocar:

pawn Код:
return 0;
Ao invйs de:

pawn Код:
return 1;



Re: Flood no carregar.... - Cromado - 11.05.2013

Lamento mais.... ainda estб flodando sem parar
pawn Код:
public checkTrailer(playerid) {
if(GetVehicleTrailer(GetPlayerVehicleID( playerid )))
{
    SendClientMessage(playerid, 0x99FFFFAA, "[ INFO ] Seu caminhгo estб carregado com petroleo leve-o atй um posto!");
}
if (PlayerToPoint(60.0, playerid, 269.9238,1351.9838,10.5859))
AttachTrailerToVehicle(5, 1);
return 0;
}



Re: Flood no carregar.... - ProKillerpa - 11.05.2013

Teste o cуdigo que postei no primeiro post ali em cima.


Re: Flood no carregar.... - Cromado - 11.05.2013

nгo adiantou nada ta fueda


Re: Flood no carregar.... - JonathanFeitosa - 11.05.2013

troque
pawn Код:
SetTimer("checkTrailer", 1000, 1);
Por:
pawn Код:
//#Edit
SetTimerEx("checkTrailer", 1000, false, "i", playerid)


Nгo se usa playerid em SetTimer. use SetTimerEx. Iria Bugar isso aew.
E estб repetindo por conta do 1 ( true ) no Timer.


Re: Flood no carregar.... - n0minal - 11.05.2013

O
jfs tб certo, mas a parte do false tem que deixar em true pois й uma
verificaзгo constante. O melhor a fazer ai e criar uma var pro player,
definir ela como 0 e mudar ela para 1 qdo for exibida a primeira msg, assim vc usa condiзoes para checar o valor da variavel antes de exibir a msg.


Re: Flood no carregar.... - BielCOP - 11.05.2013

pawn Код:
// TOPO DO GM

new MsgCarregado[MAX_PLAYERS];

forward CheckarTrailer();

// ONGAMEMODEINIT

SetTimer("CheckarTrailer",1000,1);

// ONPLAYERDISCONNECT

MsgCarregado[playerid] = 0;

// AO ENTREGAR A CARGA

MsgCarregado[playerid] = 0;

// FINAL DO GM

public CheckarTrailer()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(GetVehicleTrailer(GetPlayerVehicleID(i)))
        {
            if(MsgCarregado[i] == 0)
            {
                SendClientMessage(i, 0xFF8080AA, "INFO: Leve o seu caminhгo atй o posto!");
                MsgCarregado[i] = 1;
            }
        }
        if(IsPlayerInRangeOfPoint(i,60.0,269.9238,1351.9838,10.5859))
        {
            AttachTrailerToVehicle(5,GetPlayerVehicleID(i));
        }
    }
    return 1;
}