03.07.2016, 04:39
Here's the code:
the first time to call Dialog is under the one sec timer
//
format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(i, "PassedCode"),GetPVarInt(i, "FailedCode"));
they didnt look right in-game.
//
the first time to call Dialog is under the one sec timer
//
format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(i, "PassedCode"),GetPVarInt(i, "FailedCode"));
they didnt look right in-game.
//
Код:
if(GetPVarInt(i, "RamHouse") > 0) { if(IsPlayerInRangeOfPoint(i,2.0, HouseInfo[GetPVarInt(i, "RamHouseID")][hXo], HouseInfo[GetPVarInt(i, "RamHouseID")][hYo], HouseInfo[GetPVarInt(i, "RamHouseID")][hZo])) { SetPVarInt(i, "RamHouse", GetPVarInt(i, "RamHouse")+1); /*format(string, sizeof(string),"~w~%d", GetPVarInt(i, "RamHouse")); GameTextForPlayer(i, string, 1000, 6);*/ if(GetPVarInt(i, "RamHouse") == 21) { ApplyAnimation(i, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0); SetPVarInt(i,"Uncoding", 1); SetPVarInt(i,"UnCodeRound", 1); ProgressBar(i, "UNCODING...", 25, 4); HouseHasCCTV(i); 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[i][pUncode]); format(string,sizeof(string),"Uncoding... Source: %d:%d",GetPVarInt(i, "PassedCode"),GetPVarInt(i, "FailedCode")); ShowPlayerDialog(i,DIALOG_UNCODE,DIALOG_STYLE_PASSWORD,string,dstring,"GO","END"); //HouseInfo[GetPVarInt(i, "RamHouseID")][hLocked]=0; //DeletePVar(i,"RamHouse"); //DeletePVar(i,"RamHouseID"); //StopProgress(i); } } else { DeletePVar(i,"RamHouse"); DeletePVar(i,"RamHouseID"); SendClientMessage(i,COLOR_LIGHTRED, "TOO FAR."); StopProgress(i); } }
Код:
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, getPOS, 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, getPOS, 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; }
Код:
function SendHouseCrimeReport(hid, x, y, z, area[]) { new string[128]; if(x > 46.7115 && y > -2755.979 && x < 2931.147 && y < -548.8602) { SendFactionMessage(1, COLOR_BLUE, "HQ: All units - HQ: House Burglary."); format(string, sizeof(string), "Located at: %s", area); SendFactionMessage(1, COLOR_BLUE, string); printf("SendHouseCrimeReport Called! %d %f %f %f %s", hid, x, y, z, area); } return 1; }