I want the bought business' money to go for owners, but for not bought ones to go to no one
It'll be good with a code to work with, I don't think no one will download something just for you.
Did you said the Exterior and the Interior of the business? If not, go ahead and set it, then test again.
Maybe there is somethig wrong with interior-exterior likwhn player enter mut playerrangepoint etc.....
Just checked and found that if I set the business to sale state, I can't enter it =(
Код:
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if(PlayerToPoint(2, i,1172.0834,-1325.5232,15.4078))
{//Hospital
GameTextForPlayer(i, "~r~All Saints", 5000, 6);
SetPlayerInterior(i, 1);
SetPlayerVirtualWorld(i, 1);
SetPlayerPos(i,2087.5503,2804.2629,-15.7109);
}
if(PlayerToPoint(5, i,1921.3740,-1861.0122,13.1451))//Tune Shop
{
new tunecar = GetPlayerVehicleID(i);
SetPlayerInterior(i, 0);
SetPlayerVirtualWorld(i, 0);
SetVehiclePos(tunecar,-2206.9958,1212.1035,86.7669);
SetVehicleZAngle(tunecar,266.9718);
TogglePlayerControllable(i,0);
SetPlayerCameraPos(i,-2200.2036,1218.0535,88.4257);
SetPlayerCameraLookAt(i,-2207.7422,1212.3218,87.2468);
ShowPlayerDialog(playerid, TUNEMENU, DIALOG_STYLE_LIST, "Tune Menu","Spoilers\nHood-scoop\nRoof-scoop\nWheels\nNOS\nRear-Bumper\nFront-Bumper\nVehicle Color\nRepair\nLeave Shop ", "Tune", "Cancel");
InModShop[playerid] = 1;
}
if(PlayerToPoint(3, i,1368.6711,-1279.9377,13.5469))
{//Ammunation
GameTextForPlayer(i, "~r~Ammunation", 5000, 1);
SendClientMessage(playerid, COLOR_GREEN, " Goto the checkpoint and do /gun");
SetPlayerCheckpoint(playerid, 307.9722,-141.4586,999.6016, 2);
GunStore[playerid] = 1;
SetPlayerInterior(i, 7);
SetPlayerVirtualWorld(i, 1);
SetPlayerPos(i,314.820983,-141.431991,999.601562);
}
if(PlayerToPoint(2, i,2081.3047,2829.7400,-16.1744))
{//Hospital door 2
GameTextForPlayer(i, "~r~Garage", 5000, 6);
SetPlayerInterior(i, 1);
SetPlayerVirtualWorld(i, 1);
SetPlayerPos(i,1425.9532,-2438.2498,-10.8973);
}
if(PlayerToPoint(2, i,1425.8643,-2437.5854,-11.6056))
{//Hospital door
GameTextForPlayer(i, "~r~All Saints", 5000, 6);
SetPlayerInterior(i, 1);
SetPlayerVirtualWorld(i, 1);
SetPlayerPos(i,2081.9600,2825.2571,-16.1744);
}
if(PlayerToPoint(5, i,1141.1561,-1326.0602,13.7542))
{//LSMD Garage
new vehicleid;
vehicleid = GetPlayerVehicleID(i);
if(IsPlayerInVehicle(i, vehicleid))
{
if(gTeam[i] == 4 || PlayerInfo[i][pMember] == 4)
{
GameTextForPlayer(i, "~w~LSMD Garage", 5000, 3);
SetVehiclePos(vehicleid,1426.6069,-2447.9255,-11.4563);
SetVehicleZAngle(vehicleid, 1.4557);
SetPlayerInterior(i, 1);
SetPlayerVirtualWorld(i, 1);
}
else
{
SendClientMessage(i, COLOR_RED, " * You are not a Medic !");
}
}
else
{
SendClientMessage(i, COLOR_RED, "* You are not in a vehicle !");
}
}
if(PlayerToPoint(2, i,2045.9812,-1907.9951,13.5469))
{//Driving School
GameTextForPlayer(i, "~w~License Department", 5000, 3);
SetPlayerInterior(i, 3);
SetPlayerVirtualWorld(i, 1);
SetPlayerPos(i,-2029.5632,-117.7680,1035.1719);
SendClientMessage(playerid, COLOR_GREEN, "Goto the desk and type /getlic");
}
if(PlayerToPoint(2, i,1310.2178,-1367.0743,13.5184))
{//Paintball
GameTextForPlayer(i, "Paintball", 5000, 3);
SetPlayerInterior(playerid, 10);
GivePlayerWeapon(playerid, 29, 99999);
GivePlayerWeapon(playerid, 24, 99999);
GivePlayerWeapon(playerid, 31, 99999);
GivePlayerWeapon(playerid, 34, 99999);
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Paintball");
PaintballPlayers ++;
PlayerPaintballing[playerid] = 1;
new rand = random(sizeof(PaintballSpawns));
SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
}
if(PlayerToPoint(2, i,1153.8212,-1180.8107,32.8187))
{//FBI HQ
GameTextForPlayer(i, "~b~FBI", 5000, 3);
SetPlayerInterior(i, 3);
SetPlayerVirtualWorld(i, 1);
SetPlayerPos(i,238.7272,142.0942,1003.0234);
}
if(PlayerToPoint(2, i,690.7601,-1275.9617,13.5601))
{//Ryans HQ
GameTextForPlayer(i, "~g~American Alcatraz HQ", 5000, 3);
SetPlayerInterior(i, 1);
SetPlayerVirtualWorld(i, 1);
SetPlayerPos(i,2233.8706,1711.2141,1011.4486);
}
if(PlayerToPoint(2, i,1059.5522,-345.2047,73.9922))
{//Methlab enterace
GameTextForPlayer(i, "~b~Blue Magic lab", 5000, 3);
SetPlayerInterior(i, 1);
SetPlayerVirtualWorld(i, 5);
SetPlayerFacingAngle(i, 85.6876);
SetPlayerPos(i,963.5632,2159.4895,1011.0303);
}
/*
if(PlayerToPoint(2.0, i,1107.6245,-316.3203,74.7422))//Shack
{
SetPlayerPos(i, -2666.9397,632.9147,66.1670);
SetPlayerVirtualWorld(i, 9);
SetPlayerInterior(i, 1);
return 1;
}
*/
if(PlayerToPoint(2.0, i,870.2368,-25.2136,63.9689))//Hitman HQ Entrance
{
SetPlayerPos(i, -2171.0400,645.4891,1057.5938);
SetPlayerVirtualWorld(i, 99);
SetPlayerInterior(i, 1);
return 1;
}
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
//printf("Found House :%d",i);
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 3);
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
}
else
{
GameTextForPlayer(playerid, "~r~Locked", 5000, 3);
}
}
}
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, 3);
return 1;
}
if(BizzInfo[i][bProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 3);
return 1;
}
GivePlayerMoney(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, 3);
}
}
}
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, 3);
return 1;
}
if(SBizzInfo[i][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 3);
return 1;
}
GivePlayerMoney(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, 3);
}
}
}
/* for(new i = 0; i < sizeof(WareInfo); i++)
{
if (PlayerToPoint(3, playerid,WareInfo[i][wEntranceX], WareInfo[i][wEntranceY], WareInfo[i][wEntranceZ]))
{
//printf("Found House :%d",i);
if(PlayerInfo[playerid][pPwarekey] != i)
{
if(WareInfo[i][wLocked] == 1)
{
GameTextForPlayer(playerid, "~r~Closed", 5000, 3);
return 1;
}
format(string, sizeof(string), "~w~type /exit~n~to get out", WareInfo[i]);
OnPropUpdate();
GameTextForPlayer(playerid, string, 5000, 3);
}
SetPlayerInterior(playerid,WareInfo[i][wInterior]);
SetPlayerPos(playerid,WareInfo[i][wExitX],WareInfo[i][wExitY],WareInfo[i][wExitZ]);
PlayerInfo[playerid][pInt] = WareInfo[i][wInterior];
PlayerInfo[playerid][pLocal] = i+99;
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
printf("%s", string);
PayLog(string);
//PlayerInfo[playerid][pLocal] = i;
}
}*/
if (PlayerToPoint(3.0, playerid,-2162.2554,-2385.9541,30.6250))
{
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,387.7978,173.8582,1008.3828);
GameTextForPlayer(playerid, "~w~Welcome to the City Hall", 5000, 3);
PlayerInfo[playerid][pInt] = 3;
PlayerInfo[playerid][pLocal] = 241;
}
if (PlayerToPoint(3.0, playerid,1219.4858,-1812.9700,16.5938)) //Bounty Hunter Entrance
{
SetPlayerInterior(playerid,1);
SetPlayerPos(playerid,-2159.122802,641.517517,1052.381713);
GameTextForPlayer(playerid, "~w~Bounty Hunter HQ", 5000, 3);
PlayerInfo[playerid][pInt] = 3;
PlayerInfo[playerid][pLocal] = 241;
}
if (PlayerToPoint(3.0, playerid,2232.5249,-1333.3073,23.9816)) //Church Entrance
{
SetPlayerInterior(playerid,1);
SetPlayerPos(playerid,-2029.798339,-106.675910,1035.171875);
GameTextForPlayer(playerid, "~w~Los Santos Church", 5000, 3);
PlayerInfo[playerid][pInt] = 3;
PlayerInfo[playerid][pLocal] = 241;
}
if (PlayerToPoint(3.0, playerid,1022.3154,-1122.6476,23.8707)) //Sam Mafia Entrance
{
SetPlayerInterior(playerid,1);
SetPlayerPos(playerid,452.489990,-18.179698,1001.132812);
GameTextForPlayer(playerid, "~w~Mafia HQ", 5000, 3);
PlayerInfo[playerid][pInt] = 3;
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;
}
else if (PlayerInfo[playerid][pLeader] == 1 && PlayerToPoint(10, playerid,2175.0847,-995.0397,62.9756) && PlayerInfo[playerid][pRank] >= 4 || PlayerInfo[playerid][pMember] == 1 && PlayerToPoint(10, playerid,2175.0847,-995.0397,62.9756) && PlayerInfo[playerid][pRank] >= 4)
{//safehouse enter
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetCarPassWorld(tmpcar, 89);
SetCarPassInterior(tmpcar, 1);
SetVehiclePos(tmpcar, 2207.4109,1551.8469,1007.5931);
SetVehicleZAngle(tmpcar, 270);
SetPlayerVirtualWorld(playerid, 89);
LinkVehicleToInterior(tmpcar, 1);
SetVehicleVirtualWorld(tmpcar, 89);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid, 2207.4109,1551.8469,1007.5931);
}
GameTextForPlayer(playerid,"~w~Safe House~n~~r~Restricted Area", 5000, 3);
SetPlayerInterior(playerid,1);
PlayerInfo[playerid][pLocal] = 102;
SetPlayerFacingAngle(playerid, 270);
PlayerInfo[playerid][pInt] = 1;
SetPlayerVirtualWorld(playerid, 89);
}
else if (PlayerToPoint(3.0, playerid,1073.0619,-344.5148,73.9922))
{
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
{
SetPlayerInterior(playerid,2);
SetPlayerPos(playerid,1205.0947,-10.1685,1000.9219);
PlayerInfo[playerid][pInt] = 2;
PlayerInfo[playerid][pLocal] = 242;
}
}
else if (PlayerToPoint(3.0, playerid,2695.6235,-1704.6960,11.8438))
{
GameTextForPlayer(playerid, "~w~Welcome to the 8ball Track", 5000, 3);
SetPlayerInterior(playerid,7);
SetPlayerPos(playerid,-1404.5299,-259.0602,1043.6563);
}
else if (PlayerToPoint(8.0, playerid,-2111.5686,-443.9720,38.7344))
{
GameTextForPlayer(playerid, "~w~Welcome to the Dirt Track", 5000, 3);
SetPlayerInterior(playerid,4);
SetPlayerPos(playerid,-1443.0554,-581.1879,1055.0472);
}
else if (PlayerToPoint(8.0, playerid,-2170.3408, 635.3967, 1052.3750)) // HITMAN DOJO
{
GameTextForPlayer(playerid, "~w~Welcome to Ghost's Dojo", 5000, 3);
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid, 774.213989, -48.924297, 1000.585937);
}
else if (PlayerToPoint(8.0, playerid,-2158.4851,642.6509,1052.3750)) // HITMAN CRACK LAB
{
GameTextForPlayer(playerid, "~r~Ghost's Rapage Room", 5000, 3);
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid, 346.870025,309.259033,999.155700);
}
else if (PlayerToPoint(8.0, playerid,756.4841,-17.1075,1000.5859)) // HITMAN Meat Factory
{
GameTextForPlayer(playerid, "~r~The Factory", 5000, 3);
SetPlayerInterior(playerid,1);
SetPlayerPos(playerid, 963.418762,2108.292480,1011.030273);
}
else if (PlayerToPoint(8.0, playerid,-2080.3079,-406.0309,38.7344))
{
GameTextForPlayer(playerid, "~w~Welcome to the Stunting Track", 5000, 3);
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,-1464.7732,1557.5533,1052.5313);
}
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, 1);
SetPlayerFacingAngle(playerid, 266.1816);
SetPlayerPos(playerid,1765.4119,-1540.6046,-14.7936);
SetPlayerVirtualWorld(playerid, 1);
}
}
}
return 1;
}