boa tarde. to com outro problema o checkpoint quando você perde a estrela de procurado fica no mapa para os policiais ele não ta sumindo ao perder a estrela nem ao deslogar.
Quando da o comando /procurados e seleciona o player procurado ele aparece o checkpoint porém ele esta com problemas quando o player perde a estrela o checkpoint fica nele ainda.
ONPLAYERDISCONNECT
ONPLAYERENTERCHECKPOINT
aonde pode estar o problema?
Código PHP:
call:RemovePlayerWantedLevel(playerid)
{
if(IsPlayerPoliceTarget(playerid))
timerRemoveWantedLevel[playerid] = SetTimerEx("RemovePlayerWantedLevel", TIME_REMOVE_WANTED_LEVEL, false, "i", playerid);
else
SetPlayerWantedLevel(playerid, 0, false);
DisablePlayerRaceCheckpoint(playerid);
KillTimer(CopTimer[playerid]);
}
stock my_SetPlayerWantedLevel(playerid, level, bool:timerResetLevel = true)
{
playerWantedLevel[playerid] = level;
KillTimer(timerRemoveWantedLevel[playerid]);
DisablePlayerCheckpoint(playerid);
if(timerResetLevel)
timerRemoveWantedLevel[playerid] = SetTimerEx("RemovePlayerWantedLevel", TIME_REMOVE_WANTED_LEVEL, false, "i", playerid);
return SetPlayerWantedLevel(playerid, level);
}
Quando da o comando /procurados e seleciona o player procurado ele aparece o checkpoint porém ele esta com problemas quando o player perde a estrela o checkpoint fica nele ainda.
Código PHP:
CMD:procurados(playerid)
{
if(!IsPlayerPolice(playerid))
return SendClientMessage(playerid, COLOR_RED, TEXT_NOT_POLICE);
ShowListWantedPlayers(playerid);
return 1;
}
static ShowListWantedPlayers(playerid)
{
static info[31 + ((8 + MAX_PLAYER_NAME + 3) * MAX_PLAYERS) + 1];
new players = GetPlayerPoolSize(), bool:found, i, j;
info = DIALOG_INFO_WANTED_PLAYERS;
for(i = 0, j = 0; i <= players; i++)
{
if(playerWantedLevel[i] > 0 || GetPlayerWantedLevel(i) > 0)
{
if(!found)
found = true;
format(info, sizeof(info), "%s\n%s(%d)\t%d", info, GetNameOfPlayer(i), i, playerWantedLevel[i]);
playerListWantedPlayers[playerid][j] = i;
j++;
}
}
if(found)
ShowPlayerDialog(playerid, DIALOG_LIST_WANTED_PLAYERS, DIALOG_STYLE_TABLIST_HEADERS, DIALOG_CAPTION_WANTED_PLAYERS, info, DIALOG_BUTTON_SELECT, DIALOG_BUTTON_CLOSE);
else
ShowPlayerDialog(playerid, DIALOG_LIST_WANTED_PLAYERS + 1, DIALOG_STYLE_MSGBOX, DIALOG_CAPTION_NO_WANTED_PLAYRS, DIALOG_INFO_NOT_WANTED_PLAYERS, DIALOG_BUTTON_CONFIRM, #);
}
case DIALOG_LIST_WANTED_PLAYERS:
{
if(!response)
return 1;
listitem = playerListWantedPlayers[playerid][listitem];
if(!IsPlayerConnected(listitem))
return SendClientMessage(playerid, COLOR_RED, TEXT_LIST_WANTED_PLAYER_DISCNTD);
IsWanted[listitem] = true;
SendClientMessage(listitem,-1,"<!> {FFFFFF}Você está sendo procurado pela policia");
Procurar(playerid, listitem);
CopTimer[playerid] = SetTimerEx("Procurando", 1000 * 1, true, "ii", playerid, listitem);
return SendClientMessage(playerid, COLOR_GREEN, TEXT_LIST_WANTED_PLAYER_SUCCESS);
}
Código PHP:
DisablePlayerRaceCheckpoint(playerid);
KillTimer(CopTimer[playerid]);
ONPLAYERENTERCHECKPOINT
Código PHP:
DisablePlayerCheckpoint(playerid);
KillTimer(CopTimer[playerid]);
aonde pode estar o problema?