03.07.2016, 10:09
PHP код:
if(dialogid == DIALOG_UNCODE)
{
new Float: x, Float: y, Float:z;
new getPOS = GetPlayerPos(playerid, x, y, z);
if(!response)
{
DeletePVar(playerid, "RamHouseID");
DeletePVar(playerid, "RamHouse");
DeletePVar(playerid, "UnCodeRound");
StopProgress(playerid);
DeletePVar(playerid,"PassedCode");
DeletePVar(playerid,"FailedCode");
DeletePVar(playerid,"Uncoding");
return 1;
}
SetPVarInt(playerid,"UnCodeRound", GetPVarInt(playerid,"UnCodeRound")+1);
if(strlen(inputtext) > 0 && strlen(inputtext) < 31 && strcmp(inputtext, PlayerInfo[playerid][pUncode]) == 0)
{
if(GetPVarInt(playerid,"UnCodeRound") == 5)
{
if(GetPVarInt(playerid,"FailedCode") > GetPVarInt(playerid,"PassedCode"))
{
DeletePVar(playerid, "RamHouseID");
DeletePVar(playerid, "RamHouse");
DeletePVar(playerid, "UnCodeRound");
StopProgress(playerid);
DeletePVar(playerid,"PassedCode");
DeletePVar(playerid,"FailedCode");
DeletePVar(playerid,"Uncoding");
SetPVarInt(playerid, "PL_NotAllowed", 1);
scm(playerid, COLOR_GREY, "FAILED!");
CallRemoteFunction("SendHouseCrimeReport","ifffs", playerid, x,y,z, GetPlayerArea(playerid));
}
else
{
GameTextForPlayer(playerid, "~w~HOUSE~g~UNLOCKED!", 5000, 0);
HouseInfo[GetPVarInt(playerid, "RamHouseID")][hLocked]=0;
//reset
DeletePVar(playerid, "RamHouseID");
DeletePVar(playerid, "RamHouse");
DeletePVar(playerid, "UnCodeRound");
StopProgress(playerid);
DeletePVar(playerid,"PassedCode");
DeletePVar(playerid,"FailedCode");
DeletePVar(playerid,"Uncoding");
SetPVarInt(playerid, "PL_NotAllowed", 1);
ProgressBar(playerid, "UNCODING...", 25, 4);
}
}
PicklockString(playerid);
format(string,sizeof(string),"If you have not done when the time's end, you will be sent to next round.\nIf you have two losing streak, you will be failed and reported!\n\nPlease type the code (A-Z mixed with 0-9): %s",PlayerInfo[playerid][pUncode]);
format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(playerid, "PassedCode"),GetPVarInt(playerid, "FailedCode"));
ShowPlayerDialog(playerid,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"Go","End");
SetPVarInt(playerid,"PassedCode", 0);
SetPVarInt(playerid,"FailedCode", GetPVarInt(playerid,"FailedCode")+1);
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid,"Uncoding", 1);
SetPVarInt(playerid, "DoubleLose", 0);
return 1;
}
//Go next
if(GetPVarInt(playerid,"DoubleLose") == 2)
{
DeletePVar(playerid, "RamHouseID");
DeletePVar(playerid, "RamHouse");
DeletePVar(playerid, "UnCodeRound");
StopProgress(playerid);
DeletePVar(playerid,"PassedCode");
DeletePVar(playerid,"FailedCode");
DeletePVar(playerid,"Uncoding");
SetPVarInt(playerid, "PL_NotAllowed", 1);
scm(playerid, COLOR_GREY, "You got two losing streaks, you will be reported by CCTV!");
CallRemoteFunction("SendHouseCrimeReport","ifffs", playerid, x,y,z, GetPlayerArea(playerid));
return 1;
}
PicklockString(playerid);
ProgressBar(playerid, "UNCODING...", 25, 4);
format(string,sizeof(string),"If you have not done when the time's end, you will be sent to next round.\nIf you have two losing streak, you will be failed and reported!\n\nPlease type the code (A-Z mixed with 0-9): %s",PlayerInfo[playerid][pUncode]);
format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(playerid, "PassedCode"),GetPVarInt(playerid, "FailedCode"));
ShowPlayerDialog(playerid,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"Go","End");
SetPVarInt(playerid,"PassedCode", 0);
SetPVarInt(playerid,"FailedCode", GetPVarInt(playerid,"FailedCode")+1);
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid,"Uncoding", 1);
SetPVarInt(playerid, "DoubleLose", GetPVarInt(playerid,"DoubleLose")+1);
return 1;
}
PHP код:
CallRemoteFunction("SendHouseCrimeReport","ifffs", playerid, x,y,z, GetPlayerArea(playerid));