13.04.2010, 21:42
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (newkeys & KEY_SECONDARY_ATTACK) { if(PlayerInfo[playerid][pMaskuse] == 0) ShowPlayerNameTagForPlayer(playerid, playerid, 0); else ShowPlayerNameTagForPlayer(playerid, playerid, 1); } for(new i = 0; i < sizeof(HouseInfo); i++) { if (PlayerToPoint(3, playerid,HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ])) { //printf("Found House :%d",i); if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLocked] == 0) { SetPlayerInterior(playerid,HouseInfo[i][EnterInterior]); SetPlayerVirtualWorld(playerid,HouseInfo[i][EnterWorld]); SetPlayerPos(playerid,HouseInfo[i][hExitX],HouseInfo[i][hExitY],HouseInfo[i][hExitZ]); GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1); PlayerInfo[playerid][pInt] = HouseInfo[i][EnterInterior]; PlayerInfo[playerid][pLocal] = i; HouseEntered[playerid] = i; insidehouse[playerid] = 1; } else { GameTextForPlayer(playerid, "~r~Locked", 5000, 1); } } } for(new i = 0; i < sizeof(BizzInfo); i++) { if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ])) { //printf("Found House :%d",i); if(!IsACop(playerid) && i == 3) { SendClientMessage(playerid, COLOR_GREY, " Cops only !"); return 1; } if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost]) { if(PlayerInfo[playerid][pPbiskey] != i) { if(BizzInfo[i][bLocked] == 1) { GameTextForPlayer(playerid, "~r~Closed", 5000, 1); return 1; } SafeGivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]); format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]); BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost]; ExtortionBiz(i, BizzInfo[i][bEntranceCost]); BizzInfo[i][bProducts]--; OnPropUpdate(); GameTextForPlayer(playerid, string, 5000, 3); } SetPlayerInterior(playerid,BizzInfo[i][bInterior]); SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]); PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior]; PlayerInfo[playerid][pLocal] = i+99; new dood[MAX_PLAYER_NAME]; GetPlayerName(playerid, dood, sizeof(dood)); format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i); printf("%s", string); PayLog(string); //PlayerInfo[playerid][pLocal] = i; } else { GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1); } } } for(new i = 0; i < sizeof(SBizzInfo); i++) { if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ])) { if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost]) { if(PlayerInfo[playerid][pPbiskey] != i) { if(SBizzInfo[i][sbLocked] == 1) { GameTextForPlayer(playerid, "~r~Closed", 5000, 1); return 1; } if(SBizzInfo[i][sbProducts] == 0) { GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); return 1; } if(i == 10) { PaintballPlayers ++; PlayerPaintballing[playerid] = 1; new rand = random(sizeof(PaintballSpawns)); SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]); TogglePlayerControllable(playerid, 0); } else if(i == 11) { PlayerKarting[playerid] = 1; SendClientMessage(playerid, TEAM_GROVE_COLOR, "You can now parcipitate in a Karting Race, grab a Kart."); } else { return 1; } SafeGivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]); gSpentCash[playerid] = GetPlayerMoney(playerid); SBizzInfo[i][sbProducts]--; SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost]; ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]); new dood[MAX_PLAYER_NAME]; GetPlayerName(playerid, dood, sizeof(dood)); format(string, sizeof(string), "%s payed $%d to enter sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i); printf("%s", string); PayLog(string); OnPropUpdate(); } } else { GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1); } } } if (PlayerToPoint(3.0, playerid,2695.6235,-1704.6960,11.8438)) { GameTextForPlayer(playerid, "~w~Welcome to the 8ball Track", 5000, 1); SetPlayerInterior(playerid,7); PlayerInfo[playerid][pInt] = 7; SetPlayerPos(playerid,-1404.5299,-259.0602,1043.6563); } if (PlayerToPoint(3.0, playerid,2261.1899,-1906.7567,14.9375)) { GameTextForPlayer(playerid, "~r~NorteX14 Hq", 5000, 1); SetPlayerInterior(playerid,3); PlayerInfo[playerid][pInt] = 3; SetPlayerPos(playerid,-2640.762939,1406.682006,906.460937); } if (PlayerToPoint(3.0, playerid,1654.0148,-1654.7811,22.5156)) { GameTextForPlayer(playerid, "~w~]Fbi Head Quarters]~w~", 5000, 1); SetPlayerInterior(playerid,6); PlayerInfo[playerid][pInt] = 6; SetPlayerPos(playerid,246.783996,63.900199,1003.640625); } if (PlayerToPoint(3.0, playerid,627.1306,-571.6193,17.9145))//SD Depar { GameTextForPlayer(playerid, "]~w~Sheriff Department[", 5000, 1); SetPlayerInterior(playerid,5); PlayerInfo[playerid][pInt] = 5; SetPlayerPos(playerid,322.197998,302.197998,999.231994); } if (PlayerToPoint(3.0, playerid,1481.0206,-1771.1138,18.7958)) { GameTextForPlayer(playerid, "~w~City Hall", 5000, 1); SetPlayerInterior(playerid,3); PlayerInfo[playerid][pInt] = 3; SetPlayerPos(playerid,386.2978,173.8582,1008.3828); } if (PlayerToPoint(3.0, playerid,1173.2563,-1323.3102,15.3943)) { GameTextForPlayer(playerid, "~r~Saints Hospital", 5000, 1); SetPlayerInterior(playerid,1); PlayerInfo[playerid][pInt] = 1; SetPlayerPos(playerid,2087.5503,2804.2629,-15.7109); } if (PlayerToPoint(3.0, playerid,2470.3667,-1295.5887,30.2332))//6th street bloodz hq { GameTextForPlayer(playerid, "~r~6th Street Bloodz Hq", 5000, 1); SetPlayerInterior(playerid,8); PlayerInfo[playerid][pInt] = 8; SetPlayerPos(playerid,2807.619873,-1171.899902,1025.570312); } if (PlayerToPoint(3.0, playerid,2495.4138,-1691.1385,14.7656)) { GameTextForPlayer(playerid, "~g~Grove Street Family", 5000, 1); SetPlayerInterior(playerid,3); PlayerInfo[playerid][pInt] = 3; SetPlayerPos(playerid,2496.049804,-1695.238159,1014.742187); } if (PlayerToPoint(3.0, playerid,2247.1702,-1458.9523,24.0260))//crips hq { GameTextForPlayer(playerid, "~b~Cripz HQ", 5000, 1); SetPlayerInterior(playerid,2); PlayerInfo[playerid][pInt] = 2; SetPlayerPos(playerid,1212.019897,-28.663099,1000.953125); } if (PlayerToPoint(3.0, playerid,725.3539,-1276.4338,13.6484)) { if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { GameTextForPlayer(playerid, "~w~TheCrimsons HQ", 5000, 1); SetPlayerInterior(playerid,5); PlayerInfo[playerid][pInt] = 5; SetPlayerPos(playerid,1278.0051,-782.0831,1089.9375); } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not a Crimison Member to enter the hq !"); return 1; } } if (PlayerToPoint(3.0, playerid,2232.5249,-1333.3073,23.9816)) //Church Entrance { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,65.7219,129.4396,956.8279); GameTextForPlayer(playerid, "~w~Los Santos Church", 5000, 3); SetPlayerInterior(playerid, 0); PlayerInfo[playerid][pInt] = 0; PlayerInfo[playerid][pLocal] = 241; } else if (PlayerInfo[playerid][pLeader] == 1 && PlayerToPoint(5, playerid,1827.9487,-1538.7544,13.1849) || PlayerInfo[playerid][pMember] == 1 && PlayerToPoint(5, playerid,1827.9487,-1538.7544,13.1849)) {//prison if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1818.1245,-1536.7389,13.0869); SetVehicleZAngle(tmpcar, 83.1812); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, 1818.1245,-1536.7389,13.0869); } GameTextForPlayer(playerid,"~w~Los Santos Prison~n~~r~Restricted Area", 5000, 3); SetPlayerInterior(playerid,0); SetPlayerFacingAngle(playerid, 83.1812); PlayerInfo[playerid][pInt] = 0; } if (PlayerToPoint(3.0, playerid,1554.9537,-1675.6584,16.1953)) { GameTextForPlayer(playerid, "~b~LSPD HeadQuarters", 5000, 1); SetPlayerInterior(playerid,10); PlayerInfo[playerid][pInt] = 10; SetPlayerPos(playerid,246.375991,109.245994,1003.218750); } if (PlayerToPoint(3.0, playerid,2073.3645,-1583.0992,13.4736)) { GameTextForPlayer(playerid, "~r~Dirty Gyp Mob Hq", 5000, 1); SetPlayerInterior(playerid,5); PlayerInfo[playerid][pInt] = 5; SetPlayerPos(playerid,318.564971,1118.209960,1083.882812); } if (PlayerToPoint(3.0, playerid,2148.7578,-1484.7142,26.6243)) { GameTextForPlayer(playerid, "~r~RoLLin 20s", 5000, 1); SetPlayerInterior(playerid,12); PlayerInfo[playerid][pInt] = 12; SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083); } if (PlayerToPoint(3.0, playerid,1352.1194,-1759.2534,13.5078)) { GameTextForPlayer(playerid, "~y~24-7", 5000, 1); SetPlayerInterior(playerid,6); PlayerInfo[playerid][pInt] = 6; SetPlayerPos(playerid,-26.6916,-55.7149,1003.5469); } else if (PlayerToPoint(8.0, playerid,-2111.5686,-443.9720,38.7344)) { GameTextForPlayer(playerid, "~w~Welcome to the Dirt Track", 5000, 1); SetPlayerInterior(playerid,4); PlayerInfo[playerid][pInt] = 4; SetPlayerPos(playerid,-1443.0554,-581.1879,1055.0472); } else if (PlayerToPoint(8.0, playerid,1772.0234,-1548.0089,9.9072))// Prison { GameTextForPlayer(playerid, "~r~Welcome to the Prison", 5000, 3); SetPlayerInterior(playerid, 3); SetPlayerFacingAngle(playerid, 178.3951); SetPlayerPos(playerid,1790.5304,-1532.8323,-14.7619); } else if (PlayerToPoint(8.0, playerid,1797.9257,-1578.9176,14.0912))//Prison { if(gTeam[playerid] == 2 || IsACop(playerid)) { SetPlayerInterior(playerid, 0); SetPlayerFacingAngle(playerid, 266.1816); SetPlayerPos(playerid,84.9704,85.9833,766.3817); SetPlayerVirtualWorld(playerid, 0); } } else if (PlayerToPoint(8.0, playerid,-2080.3079,-406.0309,38.7344)) { GameTextForPlayer(playerid, "~w~Welcome to the Stunting Track", 5000, 1); SetPlayerInterior(playerid,14); PlayerInfo[playerid][pInt] = 14; SetPlayerPos(playerid,-1464.7732,1557.5533,1052.5313); } else if (PlayerToPoint(8.0, playerid,1073.0094,-345.4233,73.9922)) { GameTextForPlayer(playerid, "~w~Welcome to HitManHQ", 5000, 1); SetPlayerInterior(playerid,11); PlayerInfo[playerid][pInt] = 11; SetPlayerVirtualWorld(playerid,0) SetPlayerPos(playerid,501.980987,-69.150199,998.757812); } for(new i = 0; i < sizeof(HouseInfo); i++) { //printf("House :%d",i); if (PlayerToPoint(3, playerid,HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ])) { if(HouseEntered[playerid] == i) { SetPlayerVirtualWorld(playerid,0); SetPlayerInterior(playerid,0); SetPlayerPos(playerid,HouseInfo[i][hEnterX],HouseInfo[i][hEnterY],HouseInfo[i][hEnterZ]); Delete3DTextLabel(Text); PlayerInfo[playerid][pInt] = 0; PlayerInfo[playerid][pLocal] = 255; HouseEntered[playerid] = 255; insidehouse[playerid] = 0; } } if(PlayerInfo[playerid][pMaskuse] == 0) ShowPlayerNameTagForPlayer(playerid, playerid, 0); else ShowPlayerNameTagForPlayer(playerid, playerid, 1); } } for(new i = 0; i < sizeof(BizzInfo); i++) { //printf("Bizz :%d",i); if (PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ])) { SetPlayerInterior(playerid,0); PlayerInfo[playerid][pInt] = 0; SetPlayerPos(playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]); PlayerInfo[playerid][pLocal] = 255; } } if(GetPlayerVehicleID(playerid) >= 71 && GetPlayerVehicleID(playerid) <= 77) { TogglePlayerControllable(playerid, 1); RemovePlayerFromVehicle(playerid); } else if (PlayerToPoint(3.0, playerid,2496.049804,-1695.238159,1014.742187))//grove street { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2495.4138,-1691.1385,14.7656); } else if (PlayerToPoint(3.0, playerid,2062.1294,-1831.5498,13.5469))//pay&spray { new tmpcar = GetPlayerVehicleID(playerid); SetPlayerInterior(playerid,0); SetVehiclePos(tmpcar, 2076.5461,-1832.5647,13.5545); } else if (PlayerToPoint(3.0, playerid,322.197998,302.197998,999.231994))//SD Deparment { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,627.1306,-571.6193,17.9145); } else if (PlayerToPoint(3.0, playerid,318.564971,1118.209960,1083.882812))//Dirty Gyp Mob { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2073.3645,-1583.0992,13.4736); } else if (PlayerToPoint(3.0, playerid,2324.419921,-1145.568359,1050.710083))//RoLLin { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2148.7578,-1484.7142,26.6243); } if(PlayerToPoint(4, playerid,2087.2979,2804.6628,-16.1744)) {//Hospital AS GameTextForPlayer(playerid, "~w~Los Santos", 5000, 3); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetPlayerPos(playerid,1176.9792,-1326.2288,14.0480); } else if (PlayerInfo[playerid][pLeader] == 1 && PlayerToPoint(5, playerid,1818.6584,-1536.9752,13.1013) || PlayerInfo[playerid][pMember] == 1 && PlayerToPoint(5, playerid,1818.6584,-1536.9752,13.1013)) {//prison if (GetPlayerState(playerid) == 2) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1828.9088,-1538.5724,13.1835); SetVehicleZAngle(tmpcar, 261.1320); TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; } else { SetPlayerPos(playerid, 1828.9088,-1538.5724,13.1835); } GameTextForPlayer(playerid,"~w~Los Santos", 5000, 3); SetPlayerInterior(playerid,0); SetPlayerFacingAngle(playerid, 261.1320); PlayerInfo[playerid][pInt] = 0; } else if (PlayerToPoint(3.0, playerid,386.2978,173.8582,1008.3828))//City Hall { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1481.5450,-1768.8591,18.7958); } if (PlayerToPoint(3.0, playerid,2807.619873,-1171.899902,1025.570312))//6th street bloodz hq { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2470.3667,-1295.5887,30.2332); } else if (PlayerToPoint(3.0, playerid,1212.019897,-28.663099,1000.953125))//cripz { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2247.1702,-1458.9523,24.0260); } else if (PlayerToPoint(3.0, playerid,246.783996,63.900199,1003.640625))//FBI HQ { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1654.0148,-1654.7811,22.5156); } else if (PlayerToPoint(3.0, playerid,-2640.762939,1406.682006,906.460937))//nortenos hq exit { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2261.1899,-1906.7567,14.9375); } else if (PlayerToPoint(3.0, playerid,65.7219,129.4396,956.8279))//Church { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2232.5249,-1333.3073,23.9816); } else if (PlayerToPoint(6.0, playerid,-1404.5299,-259.0602,1043.6563)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2695.6235,-1704.6960,11.8438); } else if (PlayerToPoint(8.0, playerid,-1443.0554,-581.1879,1055.0472)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,-2111.5686,-443.9720,38.7344); } else if (PlayerToPoint(8.0, playerid,-1464.7732,1557.5533,1052.5313)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,-2080.3079,-406.0309,38.7344); } else if (PlayerToPoint(8.0, playerid,1278.0051,-782.0831,1089.9375)) //hqexit { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,725.3539,-1276.4338,13.6484); } else if (PlayerToPoint(8.0, playerid,2244.3423,-1665.5542,15.4766)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,207.7336,-108.6231,1005.1328); } else if (PlayerToPoint(8.0, playerid,501.980987,-69.150199,998.757812)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1073.0094,-345.4233,73.9922); } else if (PlayerToPoint(8.0, playerid,246.375991,109.245994,1003.218750))//lspd hq { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1554.9537,-1675.6584,16.1953); } else if (PlayerToPoint(2.0, playerid,1790.3636,-1532.8623,-14.7619))//Prison { SetPlayerInterior(playerid, 0); SetPlayerFacingAngle(playerid, 41.1771); SetPlayerPos(playerid,1767.9396,-1543.2592,9.4690); } else if (PlayerToPoint(2.0, playerid,84.9704,85.9833,766.3817))//Prison { if(gTeam[playerid] == 2 || IsACop(playerid)) { SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetPlayerFacingAngle(playerid, 180); SetPlayerPos(playerid,1797.9257,-1578.9176,14.0912); GameTextForPlayer(playerid, "~w~Los Santos", 3000, 3); } else if (PlayerToPoint(8.0, playerid,-27.3919,-58.2529,1003.5469)) { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,1352.3282,-1755.4298,13.3542); } if (((newkeys & KEY_WALK && newkeys & KEY_UP) || (newkeys & KEY_WALK && newkeys & KEY_DOWN) || (newkeys & KEY_WALK && newkeys & KEY_LEFT) || (newkeys & KEY_WALK && newkeys & KEY_RIGHT)) || ((oldkeys & KEY_WALK && newkeys & KEY_UP) || (oldkeys & KEY_WALK && newkeys & KEY_DOWN) || (oldkeys & KEY_WALK && newkeys & KEY_LEFT) || (oldkeys & KEY_WALK && newkeys & KEY_RIGHT)) || ((newkeys & KEY_WALK && oldkeys & KEY_UP) || (newkeys & KEY_WALK && oldkeys & KEY_DOWN) || (newkeys & KEY_WALK && oldkeys & KEY_LEFT) || (newkeys & KEY_WALK && oldkeys & KEY_RIGHT)) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid); return 1; }