public OnPlayerExitVehicle(playerid, vehicleid)
{
if(VDaOrg(V_Lixeiro,0,6) && InfoEmprego[playerid][PegandoLixo] == true)
{
if(IsPlayerInRangeOfPoint(playerid, 40, CoordLixeiro[InfoEmprego[playerid][Lixo]][0], CoordLixeiro[InfoEmprego[playerid][Lixo]][1], CoordLixeiro[InfoEmprego[playerid][Lixo]][2]))
{
SendClientMessage(playerid, COR_CYAN, "Pegue seu Lixo e volte para o Caminhгo ou vocк irб perder a marcaзгo de seu Lixo e terб que voltar para HQ!");
InfoEmprego[playerid][TempoCancelar] = 10;
CancelarLixo(playerid);
}
else
{
DestroyPickup(InfoEmprego[playerid][PickupLixo]);
InfoEmprego[playerid][PegandoLixo] = false;
InfoEmprego[playerid][PegouLixo] = 0;
InfoEmprego[playerid][Lixo] = -1;
InfoEmprego[playerid][PickupLixo] = 0;
DisablePlayerCheckpoint(playerid);
EsconderTextInfo(playerid);
SendClientMessage(playerid, COR_GOLD, "Vocк saiu do veнculo, sua marcaзгo foi cancelada! Vб a sua HQ e marque outra!");
}
}
return true;
}
For_Public::CancelarLixo(playerid)
{
if(VDaOrg(V_Lixeiro,0,6))
return InfoEmprego[playerid][TempoCancelar] = 0;
if(InfoEmprego[playerid][TempoCancelar] == 0)
{
InfoEmprego[playerid][TempoCancelar] = 0;
EsconderTextInfo(playerid);
InfoEmprego[playerid][PegandoLixo] = false;
InfoEmprego[playerid][PegouLixo] = 0;
InfoEmprego[playerid][Lixo] = -1;
InfoEmprego[playerid][PickupLixo] = 0;
DisablePlayerCheckpoint(playerid);
DestroyPickup(InfoEmprego[playerid][PickupLixo]);
SendClientMessage(playerid, COR_VAGOS, "Vocк nгo voltou a tempo para o Caminhгo, sendo assim foi cancelado seu Lixo!");
return true;
}
format(Str, sizeof(Str), "~p~Lixo(s) Coletado(s):~w~ %d/%d~n~~p~Distancia ao Lixo:~w~ %dm~n~~p~Tempo p/ Entrar no Caminhгo: ~w~%d", InfoEmprego[playerid][PegouLixo], Player[playerid][LevelLix]*5, floatround(GetPlayerDistanceFromPoint(playerid, CoordLixeiro[InfoEmprego[playerid][Lixo]][0], CoordLixeiro[InfoEmprego[playerid][Lixo]][1], CoordLixeiro[InfoEmprego[playerid][Lixo]][2])), InfoEmprego[playerid][TempoCancelar]);
TextDrawSetString(infoe[playerid][1], Str);
InfoEmprego[playerid][TempoCancelar]--;
return SetTimerEx("CancelarLixo", 1000, false, "i", playerid);
}
new Float: fX, Float: fY, Float: fZ;
GetPlayerPos(plyaerid, fX, fY, fZ);
printf("Debug: Distancia: %f, PosObj: %f, %f, %f, PosPlayer: %f, %f, %f.", GetPlayerDistanceFromPoint(playerid, CoordLixeiro[InfoEmprego[playerid][Lixo]][0], CoordLixeiro[InfoEmprego[playerid][Lixo]][1], CoordLixeiro[InfoEmprego[playerid][Lixo]][2]), CoordLixeiro[InfoEmprego[playerid][Lixo]][0], CoordLixeiro[InfoEmprego[playerid][Lixo]][1], CoordLixeiro[InfoEmprego[playerid][Lixo]][2], fX, fY, fZ);
[15:51:17] Debug: Distancia: 6.530883, PosObj: 1175.592651, -1880.336669, 13.593700, PosPlayer: 1176.240234, -1886.802856, 14.242933.
Originally Posted by paulor
plyaerid
|
// Todo o conteudo aqui
SetTimer("CancelarLixo",1000,0,"i",playerid);
return 1;
// Fechamento da Call Back
LOL.
mas alem do DEBUG, coloque assim: pawn Код:
|
Que parada й essa de For_Public::? Nгo to ligado. Talvez seja isso.
|
#define For_Public::%0(%1) \
forward %0(%1); public %0(%1)
print("INICIO Executado com Sucesso!!"); //Coloque no inicio da CallBack
print("FINAL Executado com Sucesso!"); //Coloque no final da CallBack
Paulor, a callback foi chamada, printou o inicio mas pelo que eu percebi na callback CancelarLixo nгo contйm erros :S
@EDIT nao printou o final @EDITІ Bom, eu consegui resolver o problema. Era erro na verificaзгo e nisso nгo chegava ao Timer para voltar a callback novamente.. Valeu paulor por ajudar e ao biel por tentar tbm, vou reputa-los ^^ |