Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //NEW
- new PickLockTimer[MAX_PLAYERS];
- new LockPicking[MAX_PLAYERS];
- //FORWARD
- forward Lockpick(playerid);
- forward Lockpickmove(playerid);
- forward Lockpickmove2(playerid);
- forward Lockpicked(playerid);
- forward Startalarm(playerid);
- forward Breakin(playerid);
- forward Breakinmove(playerid);
- forward Breakinmove2(playerid);
- forward Breakin2(playerid);
- forward RobHouse1(playerid);
- forward RobInHouse(playerid);
- forward RobInHouse2(playerid);
- forward RobbedHouse(playerid)
- //ENUM
- enum pInfo
- {
- pSpraycan,
- pScrew,
- pCrowbar,
- pHammer,
- pWrench,
- Lockpicking,
- CLockpick,
- HLockpick,
- RobHouse,
- RobHouseTime,
- RobHouseID,
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //
- public OnPlayerConnect(playerid)
- {
- LockPicking[playerid] = 999;
- PlayerInfo[playerid][Lockpicking] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(PlayerInfo[playerid][Lockpicking] != 0)
- {
- PlayerInfo[playerid][Lockpicking] = 0;
- PlayerInfo[playerid][CLockpick] = 0;
- PlayerInfo[playerid][HLockpick] = 999;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- wrench[playerid] = 0;
- hammer[playerid] = 0;
- crowbar[playerid] = 0;
- screwdriver[playerid] = 0;
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- PlayerInfo[playerid][Lockpicking] = 0;
- PlayerInfo[playerid][CLockpick] = 0;
- PlayerInfo[playerid][HLockpick] = 999;
- return 1;
- }
- public Breakin(playerid)
- {
- if(PlayerInfo[playerid][Lockpicking] == 20)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~20");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 19;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 19)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~19");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 18;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 1
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~18");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 17;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 17)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~17");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 16;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 16)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~16");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 15;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 15)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~15");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 14;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 14)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~14");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 13;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 13)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~13");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 12;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 12)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~12");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 11;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 11)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~11");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 10;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 10)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~10");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 9;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 9)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~9");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 8;
- }
- else if(PlayerInfo[playerid][Lockpicking] ==
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~8");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 7;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 7)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~7");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 6;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 6)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~6");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 5;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 5)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~5");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 4;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 4)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~4");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 3;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 3)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~3");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 2;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 2)
- {
- new string[60];
- SetTimerEx("Breakin", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~2");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 1;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 1)
- {
- new string[60];
- SetTimerEx("Breakin2", 1, false, "d", playerid);
- format(string, sizeof(string), "~r~1");
- GameTextForPlayer(playerid, string, 1000, 5);
- }
- }
- public Breakinmove(playerid)
- {
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- new house = PlayerInfo[playerid][HLockpick];
- if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[house][hLocation_x],HouseInfo[house][hLocation_y],HouseInfo[house][hLocation_z]))
- {
- SetTimerEx("Breakinmove", 1000, false, "d", playerid);
- return 1;
- }
- else
- {
- SetTimerEx("Breakinmove2", 1, false, "d", playerid);
- return 1;
- }
- }
- return 1;
- }
- public Breakinmove2(playerid)
- {
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- new house = PlayerInfo[playerid][HLockpick];
- if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[house][hLocation_x],HouseInfo[house][hLocation_y],HouseInfo[house][hLocation_z]))
- {
- SetTimerEx("Breakinmove", 1, false, "d", playerid);
- return 1;
- }
- else
- {
- new string[128];
- format(string,sizeof(string),"** You moved from your position, lockpick failed.");
- SendClientMessage(playerid, COLOR_WHITE, string);
- PlayerInfo[playerid][Lockpicking] = 0;
- PlayerInfo[playerid][HLockpick] = 999;
- return 1;
- }
- }
- return 1;
- }
- public Breakin2(playerid)
- {
- new string[128];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerNameEx(playerid, sendername, sizeof(sendername));
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- new house = PlayerInfo[playerid][HLockpick];
- SendClientMessage(playerid, COLOR_WHITE, "Door {2F991A}unlocked!");
- PlayerInfo[playerid][Lockpicking] = 0;
- PlayerInfo[playerid][HLockpick] = 999;
- HouseInfo[house][hLocked] = 0;
- if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
- format(string, sizeof(string), "* %s has successfully unlocked the door.", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
- return 1;
- }
- return 1;
- }
- public Lockpick(playerid)
- {
- if(PlayerInfo[playerid][Lockpicking] == 60)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~60");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 59;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 59)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~59");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 58;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 5
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~58");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 57;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 57)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~57");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 56;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 56)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~56");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 55;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 55)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~55");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 54;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 54)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~54");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 53;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 53)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~53");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 52;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 52)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~52");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 51;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 51)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~51");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 50;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 50)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~50");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 49;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 49)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~49");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 48;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 4
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~48");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 47;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 47)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~47");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 46;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 46)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~46");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 45;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 45)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~45");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 44;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 44)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~44");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 43;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 43)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~43");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 42;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 42)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~42");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 41;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 41)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- SetTimerEx("Startalarm", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~41");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 40;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 40)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~40");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 39;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 39)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~39");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 38;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 3
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~38");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 37;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 37)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~37");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 36;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 36)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~36");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 35;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 35)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~35");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 34;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 34)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~34");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 33;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 33)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~33");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 32;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 32)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~32");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 31;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 31)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~31");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 30;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 30)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~30");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 29;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 29)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~29");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 28;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 2
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~28");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 27;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 27)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~27");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 26;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 26)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~26");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 25;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 25)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~25");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 24;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 24)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~24");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 23;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 23)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~23");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 22;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 22)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~22");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 21;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 21)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- SetTimerEx("Startalarm", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~21");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 20;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 20)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~20");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 19;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 19)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~19");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 18;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 1
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~18");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 17;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 17)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~17");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 16;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 16)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~16");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 15;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 15)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~15");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 14;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 14)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~14");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 13;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 13)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~13");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 12;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 12)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~12");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 11;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 11)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~g~11");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 10;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 10)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~10");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 9;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 9)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~9");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 8;
- }
- else if(PlayerInfo[playerid][Lockpicking] ==
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~8");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 7;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 7)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~7");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 6;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 6)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~6");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 5;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 5)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~5");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 4;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 4)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~4");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 3;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 3)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~3");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 2;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 2)
- {
- new string[60];
- SetTimerEx("Lockpick", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~2");
- GameTextForPlayer(playerid, string, 1000, 5);
- PlayerInfo[playerid][Lockpicking] = 1;
- }
- else if(PlayerInfo[playerid][Lockpicking] == 1)
- {
- new string[60];
- SetTimerEx("Lockpicked", 1, false, "d", playerid);
- SetTimerEx("Startalarm", 1000, false, "d", playerid);
- format(string, sizeof(string), "~r~1");
- GameTextForPlayer(playerid, string, 1000, 5);
- }
- }
- public Startalarm(playerid)
- {
- new engine,lights,alarm,doors,bonnet,boot,objective;
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- if(CarInfo[PlayerInfo[playerid][CLockpick]][tAlarmStarted] == 1)
- {
- GetVehicleParamsEx(PlayerInfo[playerid][CLockpick],engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(PlayerInfo[playerid][CLockpick],engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot ,objective);
- }
- }
- return 1;
- }
- public Lockpickmove(playerid)
- {
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- new Float:cX, Float:cY, Float:cZ;
- new car = PlayerInfo[playerid][CLockpick];
- GetVehiclePos(car, cX, cY, cZ);
- if(IsPlayerInRangeOfPoint(playerid, 2.0, cX, cY, cZ))
- {
- SetTimerEx("Lockpickmove", 1000, false, "d", playerid);
- return 1;
- }
- else
- {
- SetTimerEx("Lockpickmove2", 1, false, "d", playerid);
- return 1;
- }
- }
- return 1;
- }
- public Lockpickmove2(playerid)
- {
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- new Float:cX, Float:cY, Float:cZ;
- new car = PlayerInfo[playerid][CLockpick];
- GetVehiclePos(car, cX, cY, cZ);
- if(IsPlayerInRangeOfPoint(playerid, 2.0, cX, cY, cZ))
- {
- SetTimerEx("Lockpickmove", 1, false, "d", playerid);
- return 1;
- }
- else
- {
- new string[128];
- format(string,sizeof(string),"** You moved from your position, lockpick failed.");
- SendClientMessage(playerid, COLOR_WHITE, string);
- PlayerInfo[playerid][Lockpicking] = 0;
- PlayerInfo[playerid][CLockpick] = 0;
- CarInfo[car][tAlarmStarted] = 0;
- return 1;
- }
- }
- return 1;
- }
- public Lockpicked(playerid)
- {
- new string[128];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerNameEx(playerid, sendername, sizeof(sendername));
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- new engine,lights,alarm,doors,bonnet,boot,objective;
- new car = PlayerInfo[playerid][CLockpick];
- GetVehicleParamsEx(car,engine,lights,alarm,doors,b onnet,boot,objective);
- SetVehicleParamsEx(car,engine,lights,alarm,VEHICLE _PARAMS_OFF,bonnet,boot,objective);
- SendClientMessage(playerid, COLOR_WHITE, "Vehicle {2F991A}unlocked!");
- PlayerInfo[playerid][Lockpicking] = 0;
- PlayerInfo[playerid][CLockpick] = 0;
- CarInfo[car][tAlarmStarted] = 0;
- CarInfo[car][tLock] = 0;
- if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
- format(string, sizeof(string), "* %s has successfully unlocked the vehicle.", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
- }
- return 1;
- }
- if(strcmp(cmd, "/lockpick", true) == 0)
- {
- new counter = 0;
- new result;
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetPlayerNameEx(playerid, sendername, sizeof(sendername));
- new plyName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
- for(new i; i != MAX_VEHICLES; i++)
- {
- new dist = CheckPlayerDistanceToVehicle(2, playerid, i);
- if(dist)
- {
- result = i;
- counter++;
- }
- }
- switch(counter)
- {
- case 0:
- {
- SendClientMessage(playerid, COLOR_GREY, " No cars near you");
- return 1;
- }
- case 1:
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_GREY, " You can't lockpick the vehicle if you're inside it");
- return 1;
- }
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " You are already lockpicking this vehicle");
- return 1;
- }
- if(PlayerInfo[playerid][pScrew] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " Your need a screwdriver do lockpick a vehicle!");
- return 1;
- }
- if(CarInfo[result][tLock] != 1)
- {
- SendClientMessage(playerid, COLOR_RED, "This vehicle is already unlocked");
- return 1;
- }
- if(screwdriver[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " You're not holding a screwdriver (( /screwdriver ))!");
- return 1;
- }
- new owner[MAX_PLAYER_NAME];
- strmid(owner, CarInfo[result][tOwner], 0, strlen(CarInfo[result][tOwner]), 255);
- giveplayerid = ReturnUser(owner);
- if(IsPlayerConnected(giveplayerid))
- {
- PlayerInfo[playerid][Lockpicking] = 60;
- PlayerInfo[playerid][CLockpick] = result;
- PlayerInfo[playerid][pScrew]--;
- if(CarInfo[result][tAlarm] == 1)
- {
- new Float:cX, Float:cY, Float:cZ;
- new car = PlayerInfo[playerid][CLockpick];
- GetVehiclePos(car, cX, cY, cZ);
- GetVehicleParamsEx(result,engine,lights,alarm,door s,bonnet,boot,objective);
- SetVehicleParamsEx(result,engine,lights,VEHICLE_PA RAMS_ON,doors,bonnet,boot,objective);
- CarInfo[result][tAlarmStarted] = 1;
- SetPlayerCheckpoint(giveplayerid, cX, cY, cZ, 3.0);
- SendClientMessage(giveplayerid, COLOR_WHITE, "["CB"SMS Inbox"CW"] "CB" Sender:"CW" We're watching...™");
- SendClientMessage(giveplayerid, COLOR_WHITE, ""CB"Message:"CW" You received this message because one of your vehicle alarm has been activated");
- }
- if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
- format(string, sizeof(string), "** %s pulls out a screwdriver and begins lockpicking the vehicle...", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "** It takes you 1 minute to lockpick the vehicle...");
- SetTimerEx("Lockpick", 1, false, "d", playerid);
- SetTimerEx("Lockpickmove", 1, false, "d", playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " The owner of this car is offline, you can't lockpick it ");
- return 1;
- }
- }
- default:
- {
- SendClientMessage(playerid, COLOR_GREY, " Found more then one car in range");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmdtext,"/breakin",true)==0)
- {
- for(new h = 0; h < sizeof(HouseInfo); h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[h][hLocation_x],HouseInfo[h][hLocation_y],HouseInfo[h][hLocation_z]))
- {
- if(HouseInfo[h][hLocked] == 0)
- {
- SendClientMessage(playerid,COLOR_GRAD1,"This house is not locked!");
- return 1;
- }
- if(PlayerInfo[playerid][Lockpicking] > 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " You are already lockpicking this house");
- return 1;
- }
- if(PlayerInfo[playerid][pCrowbar] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " Your need a crowbar do lockpick a door!");
- return 1;
- }
- if(crowbar[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " You're not holding a crowbar (( /crowbar ))!");
- return 1;
- }
- new owner[MAX_PLAYER_NAME];
- strmid(owner, HouseInfo[h][hOwner], 0, strlen(HouseInfo[h][hOwner]), 255);
- giveplayerid = ReturnUser(owner);
- PlayerInfo[playerid][Lockpicking] = 20;
- PlayerInfo[playerid][HLockpick] = h;
- PlayerInfo[playerid][pScrew]--;
- if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
- format(string, sizeof(string), "** %s pulls out a screwdriver and begins lockpicking the house...", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "** It takes you 20 seconds to unlock this house...");
- if(HouseInfo[h][hAlarmON] == 1)
- {
- if(IsPlayerConnected(giveplayerid))
- {
- SetPlayerCheckpoint(giveplayerid, HouseInfo[h][hLocation_x],HouseInfo[h][hLocation_y],HouseInfo[h][hLocation_z], 3.0);
- SendClientMessage(giveplayerid, COLOR_WHITE, "["CB"SMS Inbox"CW"] "CB" Sender:"CW" We're watching...™");
- SendClientMessage(giveplayerid, COLOR_WHITE, ""CB"Message:"CW" You received this message because your house alarm has been activated");
- }
- }
- SetTimerEx("Breakin", 1, false, "d", playerid);
- SetTimerEx("Breakinmove", 1, false, "d", playerid);
- return 1;
- }
- }
- }
- if(strcmp(cmdtext,"/robhouse",true)==0)
- {
- for(new h = 0; h < sizeof(HouseInfo); h++)
- {
- if(PlayerInfo[playerid][pInHouse] == 999)
- {
- SendClientMessage(playerid, COLOR_GREY, " Your need to be in a house to do this!");
- return 1;
- }
- new houseid = PlayerInfo[playerid][pInHouse];
- if(HouseInfo[houseid][hVulnerable] != 0)
- {
- SendClientMessage(playerid,COLOR_GRAD1,"This house was recently robbed!");
- return 1;
- }
- if(PlayerInfo[playerid][pCrowbar] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " Your need a crowbar to rob a house!");
- return 1;
- }
- new owner[MAX_PLAYER_NAME];
- strmid(owner, HouseInfo[h][hOwner], 0, strlen(HouseInfo[h][hOwner]), 255);
- giveplayerid = ReturnUser(owner);
- PlayerInfo[playerid][RobHouseTime] = 5;
- PlayerInfo[playerid][RobHouseID] = houseid;
- PlayerInfo[playerid][RobHouse] = 1;
- PlayerInfo[playerid][pCrowbar]--;
- if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
- format(string, sizeof(string), "** %s pulls out a crowbar and begins searching in the house...", sendername);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "** You have to stay inside the house for 5 minutes");
- SetTimerEx("RobHouse1", 1, false, "d", playerid);
- SetTimerEx("RobInHouse", 1, false, "d", playerid);
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment