boa noite. se o player demora uns 30 segundos pra digitar a senha ele digita e spawna fora da cadeia mesmo o tempo contando.
codigo
alguem ajuda??
codigo
Código PHP:
static PutPlayerInChainAdmin(playerid, time)
{
time = gettime() + time;//(60 * time);
playerChainAdmin[playerid][E_PLAYER_IN_CHAIN] = true;
playerChainAdmin[playerid][E_PLAYER_CHAIN_TIME] = time;
SetPlayerWantedLevel(playerid, 0);
if(IsPlayerCuffed(playerid))
UnshacklePlayer(playerid, REASON_NONE);
if(IsPlayerArrasted(playerid))
ChangePlayerArrestedState(playerid, GetPlayerArrastedMe(playerid), REASON_ADMIN);
if(IsPlayerApproached(playerid))
ChangePlayerApproachedState(playerid, GetPlayerApproachedMe(playerid), REASON_ADMIN);
TogglePlayerControllable(playerid, true);
SetPlayerTeam(playerid, TEAM_JAIL);
SetPlayerClass(playerid, PLAYER_CLASS_CIVIL);
SetPlayerInterior(playerid, 6);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, prisionPosition[0], prisionPosition[1], prisionPosition[2]);
SetPlayerFacingAngle(playerid, prisionPosition[3]);
SetPlayerHealth(playerid, 99999);
SetCameraBehindPlayer(playerid);
SetTimerEx("ShowPlayerPrisionTime", 900, false, "iii", playerid, time, 1);
}
static RemovePlayerFromChainAdmin(playerid)
{
SetPlayerClass(playerid, PLAYER_CLASS_CIVIL);
SetPlayerInterior(playerid, 0);
SetPlayerWorld(playerid, 0);
ResetPlayerChainAdmin(playerid);
SavePlayerChainAdmin(playerid);
SpawnPlayer(playerid);
SetPlayerHealth(playerid, 100.0);
GameTextForPlayer(playerid, "Livre", 1, 3);
}
ResetPlayerChainAdmin(playerid)
{
playerChainAdmin[playerid][E_PLAYER_IN_CHAIN] = false;
playerChainAdmin[playerid][E_PLAYER_CHAIN_TIME] = 0;
}
call:LoadPlayerChainAdmin(playerid)
{
if(!IsPlayerConnected(playerid))
return;
if(dir_exists(DIRECTORY_CHAIN_ADMIN))
{
new file[9 + MAX_PLAYER_NAME + 1];
format(file, sizeof(file), PLAYER_FILE_CHAIN_ADMIN_CFG, Nome(playerid));
if(DOF2_FileExists(file))
{
playerChainAdmin[playerid][E_PLAYER_IN_CHAIN] = DOF2_GetBool(file, "inChainAdmin");
playerChainAdmin[playerid][E_PLAYER_CHAIN_TIME] = DOF2_GetInt(file, "chainTime");/* + gettime();*/
if(playerChainAdmin[playerid][E_PLAYER_IN_CHAIN] && playerChainAdmin[playerid][E_PLAYER_CHAIN_TIME] > 0)
{
SendClientMessage(playerid, COLOR_YELLOW, TEXT_PLAYER_JAIL_INCOMPLETE);
PutPlayerInChainAdmin(playerid, playerChainAdmin[playerid][E_PLAYER_CHAIN_TIME]);
}
else
{
ResetPlayerChainAdmin(playerid);
DOF2_RemoveFile(file);
DOF2_SaveFile();
}
}
}
}
alguem ajuda??