Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:enter(playerid, params[])
- {
- if(!pLoggedIn[playerid])return true;
- new string[128];
- if(StartedTruckerMission[playerid] && TruckerMissionStep[playerid] == 2)
- return SendClientMessage(playerid, COLOR_ADM, "** You can't enter while delivering.");
- for(new h = 0; h < MAX_PROPERTY; h++){
- if(PropertyData[h][propertyid] != 0){
- if(PropertyData[h][propertyType] == 2){
- if(IsPlayerInRangeOfPoint(playerid, 3.0, PropertyData[h][propertyExterior][0], PropertyData[h][propertyExterior][1], PropertyData[h][propertyExterior][2])){
- if(GetPlayerInterior(playerid) == PropertyData[h][propertyExteriorID] && GetPlayerVirtualWorld(playerid) == PropertyData[h][propertyExteriorWorld] && PlayerData[playerid][pCheckpoint] == h){
- if(PropertyData[h][propertyLocked]){
- GameTextForPlayer(playerid, "~r~Locked", 2000, 1);
- }
- else{
- if(IsPlayerInAnyVehicle(playerid))
- return SendClientMessage(playerid, COLOR_ADM, "You are not able to enter due to being in a vehicle!");
- SendPlayer(playerid, PropertyData[h][propertyInterior][0], PropertyData[h][propertyInterior][1], PropertyData[h][propertyInterior][2], PropertyData[h][propertyInteriorID], PropertyData[h][propertyInteriorWorld]);
- SetPlayerFacingAngle(playerid, PropertyData[h][propertyInterior][3]);
- SetTimerEx("LoadingStream", 50, false, "i", playerid);
- SetTimerEx("EndStream", 300, false, "i", playerid);
- PlayerData[playerid][pInsideApartment] = h;
- PlayerData[playerid][pInsideComplex] = 0;
- DisablePlayerCheckpoint(playerid);
- PlayerData[playerid][pCheckpoint] = 0;
- if (PropertyData[h][propertyXMROn]){
- PlayAudioStreamForPlayer(playerid, PropertyData[h][propertyXMRUrl]);
- }
- }
- }
- }
- }
- else{
- if(IsPlayerInRangeOfPoint(playerid, 3.0, PropertyData[h][propertyExterior][0], PropertyData[h][propertyExterior][1], PropertyData[h][propertyExterior][2])){
- if(GetPlayerVirtualWorld(playerid) == PropertyData[h][propertyExteriorWorld]){
- if(PropertyData[h][propertyLocked]){
- GameTextForPlayer(playerid, "~r~Locked", 2000, 1);
- }
- else{
- if(IsPlayerInAnyVehicle(playerid))
- return SendClientMessage(playerid, COLOR_ADM, "You are not able to enter due to being in a vehicle!");
- SendPlayer(playerid, PropertyData[h][propertyInterior][0], PropertyData[h][propertyInterior][1], PropertyData[h][propertyInterior][2], PropertyData[h][propertyInteriorID], PropertyData[h][propertyInteriorWorld]);
- SetPlayerFacingAngle(playerid, PropertyData[h][propertyInterior][3]);
- SetTimerEx("LoadingStream", 50, false, "i", playerid);
- SetTimerEx("EndStream", 300, false, "i", playerid);
- if(PropertyData[h][propertyType] == 1){
- PlayerData[playerid][pInsideComplex] = h;
- }
- if(PropertyData[h][propertyType] == 3){
- PlayerData[playerid][pInsideHouse] = h;
- }
- DisablePlayerCheckpoint(playerid);
- PlayerData[playerid][pCheckpoint] = 0;
- if (PropertyData[h][propertyXMROn]){
- PlayAudioStreamForPlayer(playerid, PropertyData[h][propertyXMRUrl]);
- }
- }
- }
- }
- }
- }
- }
- for(new b = 0; b < MAX_BUSINESS; b++)
- {
- if(BusinessData[b][businessID] != 0){
- if(IsPlayerInRangeOfPoint(playerid, 3.0, BusinessData[b][businessExt][0], BusinessData[b][businessExt][1], BusinessData[b][businessExt][2])){
- if(BusinessData[b][businessLocked]){
- GameTextForPlayer(playerid, "~r~Locked", 3000, 1);
- }
- else{
- if(BusinessData[b][businessType] == 8 || BusinessData[b][businessType] == 9){
- GameTextForPlayer(playerid, "~r~Closed", 3000, 1);
- return true;
- }
- if(IsPlayerInAnyVehicle(playerid))
- return SendClientMessage(playerid, COLOR_ADM, "You are not able to enter due to being in a vehicle!");
- SendPlayer(playerid, BusinessData[b][businessInt][0], BusinessData[b][businessInt][1], BusinessData[b][businessInt][2], BusinessData[b][businessIntID], BusinessData[b][businessWorld]);
- SetPlayerFacingAngle(playerid, BusinessData[b][businessInt][3]);
- SetTimerEx("LoadingStream", 50, false, "i", playerid);
- SetTimerEx("EndStream", 300, false, "i", playerid);
- if(PlayerData[playerid][pSQLID] != BusinessData[b][businessOwnerSQL]) {
- GiveMoney(playerid, -BusinessData[b][businessFee]);
- BusinessData[b][businessCashbox]+= BusinessData[b][businessFee];
- }
- format(string, sizeof(string), "~w~%s", BusinessData[b][businessName]);
- GameTextForPlayer(playerid, string, 3000, 1);
- PlayerData[playerid][pInsideBusiness] = b;
- BusinessTypeMessage(playerid, b);
- }
- }
- }
- }
- for(new p = 0; p < MAX_PAYNSPRAY; p++)
- {
- if(PNSData[p][pnsID] != 0){
- if(IsPlayerInRangeOfPoint(playerid, 4.0, PNSData[p][pnsEntrance][0], PNSData[p][pnsEntrance][1], PNSData[p][pnsEntrance][2])){
- if (PNSData[p][pnsOccupied])return SendClientMessage(playerid, COLOR_ADM, "SERVER: Pay N Spray Occupied.");
- if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)return SendClientMessage(playerid, COLOR_ADM, "ERROR:{FFFFFF} You aren't in a car.");
- if (PlayerData[playerid][pMoney] < PNSData[p][pnsPrice])return SendClientMessage(playerid, COLOR_ADM, "SERVER: Insufficient Funds.");
- SendPlayer(playerid, PNSData[p][pnsRepairSpot][0], PNSData[p][pnsRepairSpot][1], PNSData[p][pnsRepairSpot][2], 0, 0);
- GiveMoney(playerid, -PNSData[p][pnsPrice]);
- PlayerData[playerid][pInsidePNS] = p;
- SetPVarInt(playerid, "InsidePNSVehicle", GetPlayerVehicleID(playerid));
- PNSData[p][pnsOccupied] = true;
- PNSData[p][pnsEarnings]+= PNSData[p][pnsPrice];
- SetTimerEx("TIMER_ExitPNS", 9500, false, "i", playerid);
- TogglePlayerControllable(playerid, false);
- SendClientMessage(playerid, COLOR_DARKGREEN, "Auto-Voice: You'll be moved out in 10 seconds.");
- GameTextForPlayer(playerid, "~g~REPAIRING...", 5000, 4);
- }
- }
- }
- for(new d = 0; d < MAX_DOORS; d++)
- {
- if(DoorData[d][doorID] != 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, DoorData[d][doorPos][0], DoorData[d][doorPos][1], DoorData[d][doorPos][2]))
- {
- if(GetPlayerVirtualWorld(playerid) == DoorData[d][doorPosWorld])
- {
- if(DoorData[d][doorLocked])return GameTextForPlayer(playerid, "~r~Locked", 3000, 1);
- if(IsPlayerInAnyVehicle(playerid))
- return SendClientMessage(playerid, COLOR_ADM, "You are not able to enter due to being in a vehicle!");
- SetPlayerPos(playerid, DoorData[d][doorInt][0], DoorData[d][doorInt][1], DoorData[d][doorInt][2]);
- SetPlayerInterior(playerid, DoorData[d][doorIntID]);
- SetPlayerVirtualWorld(playerid, DoorData[d][doorIntWorld]);
- SetPlayerFacingAngle(playerid, DoorData[d][doorInt][3]);
- SetTimerEx("LoadingStream", 50, false, "i", playerid);
- SetTimerEx("EndStream", 300, false, "i", playerid);
- PlayerData[playerid][pInsideDoor] = d;
- }
- }
- }
- }
- for(new g = 0; g < MAX_PROPERTY_GARAGES; g++)
- {
- if(GarageData[g][garageSQLID] != 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 4.0, GarageData[g][garagePos][0], GarageData[g][garagePos][1], GarageData[g][garagePos][2]))
- {
- if(GarageData[g][garageLocked])return GameTextForPlayer(playerid, "~r~Locked", 3000, 1);
- SendPlayer(playerid, GarageData[g][garageInt][0], GarageData[g][garageInt][1], GarageData[g][garageInt][2], GarageData[g][garageInteriorID], GarageData[g][garageWorld]);
- PlayerData[playerid][pInsideGarage] = g;
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- foreach(new i : Player)
- {
- if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)))
- {
- SetPlayerVirtualWorld(i, GarageData[g][garageWorld]);
- SetPlayerInterior(i, GarageData[g][garageInteriorID]);
- PlayerData[i][pInsideGarage] = g;
- }
- }
- SetVehicleZAngle(GetPlayerVehicleID(playerid), 90);
- }
- }
- }
- }
- new idx;
- if(IsPlayerNearEntrance(playerid) != -1)
- {
- idx = IsPlayerNearEntrance(playerid);
- if(IsEntranceLocked(idx) && !PlayerData[playerid][pAdminDuty])
- return GameTextForPlayer(playerid, "~r~Locked", 3000, 1);
- if(IsPlayerInAnyVehicle(playerid))
- return SendClientMessage(playerid, COLOR_ADM, "You are not able to enter due to being in a vehicle!");
- EnterEntrance(playerid, idx);
- SetTimerEx("LoadingStream", 50, false, "i", playerid);
- SetTimerEx("EndStream", 300, false, "i", playerid);
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement