Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:asellbiz(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 5 || PlayerInfo[playerid][pShopTech] == 1)
- {
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- new string[128], bizid;
- if(sscanf(params, "d", bizid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /asellbiz [bizid]");
- arrBusinessData[bizid][b_iLocked] = 1;
- arrBusinessData[bizid][b_iSafeMoney] = 0;
- arrBusinessData[bizid][b_szOwner][0] = 0;
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~You have sold business %d.", bizid);
- GameTextForPlayer(playerid, string, 10000, 3);
- SaveBusiness();
- DestroyDynamicPickup(arrBusinessData[bizid][b_iPickupID]);
- arrBusinessData[bizid][b_iPickupID] = CreateDynamicPickup(1239, 23, arrBusinessData[bizid][b_fExteriorPos][0], arrBusinessData[bizid][b_fExteriorPos][1], arrBusinessData[bizid][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- format(string, sizeof(string), "{E8A831}This business is for sale for $%d!\n{33AA33}/buybiz to purchase.\nID: %d", arrBusinessData[bizid][b_iValue], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- return 1;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:asellgarage(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 5 || PlayerInfo[playerid][pShopTech] == 1)
- {
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- new string[128], garageid;
- if(sscanf(params, "d", garageid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /asellgarage [garageid]");
- arrGarage[garageid][b_iLocked] = 1;
- arrGarage[garageid][b_iSafeMoney] = 0;
- arrGarage[garageid][b_szOwner][0] = 0;
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~You have sold garage %d.", garageid);
- GameTextForPlayer(playerid, string, 10000, 3);
- SaveGarages();
- DestroyDynamicPickup(arrGarage[garageid][b_iPickupID]);
- arrGarage[garageid][b_iPickupID] = CreateDynamicPickup(1239, 23, arrGarage[garageid][b_fExteriorPos][0], arrGarage[garageid][b_fExteriorPos][1], arrGarage[garageid][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- format(string, sizeof(string), "{E8A831}This garage is for sale for $%d!\n{33AA33}/buygarage to purchase.\nID: %d", arrGarage[garageid][b_iValue], garageid);
- UpdateDynamic3DTextLabelText(arrGarage[garageid][b_tLabelID], COLOR_GREEN, string);
- return 1;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:gotogarage(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pShopTech] == 1)
- {
- new garageid;
- if(sscanf(params, "d", garageid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gotogarage [bizid]");
- SetPlayerPos(playerid,arrGarage[garageid][b_fExteriorPos][0],arrGarage[garageid][b_fExteriorPos][1],arrGarage[garageid][b_fExteriorPos][2]);
- GameTextForPlayer(playerid, "~w~Teleporting", 5000, 1);
- SetPlayerInterior(playerid, 0);
- PlayerInfo[playerid][pVW] = 0;
- }
- return 1;
- }
- CMD:gotobiz(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pShopTech] == 1)
- {
- new bizid;
- if(sscanf(params, "d", bizid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gotobiz [bizid]");
- SetPlayerPos(playerid,arrBusinessData[bizid][b_fExteriorPos][0],arrBusinessData[bizid][b_fExteriorPos][1],arrBusinessData[bizid][b_fExteriorPos][2]);
- GameTextForPlayer(playerid, "~w~Teleporting", 5000, 1);
- SetPlayerInterior(playerid, 0);
- PlayerInfo[playerid][pVW] = 0;
- }
- return 1;
- }
- CMD:garageedit(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You are not authorized to use that command!");
- return 1;
- }
- new string[128], choice[32], garageid, amount;
- new lockedinfo[20];
- if(arrGarage[garageid][b_iLocked] == 0)
- { lockedinfo = "Open"; }
- if(arrGarage[garageid][b_iLocked] == 1)
- { lockedinfo = "Closed"; }
- else { lockedinfo = "Open"; }
- if(sscanf(params, "s[32]dD(0)", choice, garageid, amount))
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /garageedit [name] [garageid] [optional amount]");
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Commands: Exterior | Interior | Vault | Price | Delete");
- return 1;
- }
- else if(strcmp(choice, "exterior", true) == 0)
- {
- GetPlayerPos(playerid, arrGarage[garageid][b_fExteriorPos][0], arrGarage[garageid][b_fExteriorPos][1], arrGarage[garageid][b_fExteriorPos][2]);
- GetPlayerFacingAngle(playerid, arrGarage[garageid][b_fExteriorPos][3]);
- SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the exterior for this garage!" );
- DestroyDynamicPickup(arrGarage[garageid][b_iPickupID]);
- SaveGarages();
- if(isnull(arrGarage[garageid][b_szOwner]))
- {
- DestroyDynamicPickup(arrGarage[garageid][b_iPickupID]);
- DestroyDynamic3DTextLabel(arrGarage[garageid][b_tLabelID]);
- format(string, sizeof(string), "{E8A831}This garage is for sale for $%d!\n{33AA33}/buygarage to purchase.\nID: %d", arrGarage[garageid][b_iValue], garageid);
- arrGarage[garageid][b_tLabelID] = CreateDynamic3DTextLabel(string, COLOR_GREEN, arrGarage[garageid][b_fExteriorPos][0], arrGarage[garageid][b_fExteriorPos][1], arrGarage[garageid][b_fExteriorPos][2]+0.5,30.0, .testlos = 1, .streamdistance = 30.0, .worldid = 0, .interiorid = 0);
- arrGarage[garageid][b_iPickupID] = CreateDynamicPickup(1239, 23, arrGarage[garageid][b_fExteriorPos][0], arrGarage[garageid][b_fExteriorPos][1], arrGarage[garageid][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- arrGarage[garageid][b_iInteriorID] = 1;
- arrGarage[garageid][b_fInteriorPos][0] = 608.6995;
- arrGarage[garageid][b_fInteriorPos][1] = -1.8454;
- arrGarage[garageid][b_fInteriorPos][2] = 1001.2202;
- }
- }
- if(strcmp(choice, "interior", true) == 0)
- {
- GetPlayerPos(playerid, arrGarage[garageid][b_fInteriorPos][0], arrGarage[garageid][b_fInteriorPos][1], arrGarage[garageid][b_fInteriorPos][2]);
- GetPlayerFacingAngle(playerid, arrGarage[garageid][b_fInteriorPos][3]);
- arrGarage[garageid][b_iInteriorID] = GetPlayerInterior(playerid);
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the interior for the garage!");
- SaveGarages();
- return 1;
- }
- if(strcmp(choice, "vault", true) == 0)
- {
- arrGarage[garageid][b_iSafeMoney] = amount;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the vault amount for that business!" );
- SaveBusiness();
- return 1;
- }
- else if(strcmp(choice, "delete", true) == 0)
- {
- if(IsValidDynamicPickup(arrGarage[garageid][b_iPickupID])) DestroyDynamicPickup(arrGarage[garageid][b_iPickupID]);
- DestroyDynamic3DTextLabel(arrGarage[garageid][b_tLabelID]);
- arrGarage[garageid][b_fExteriorPos][0] = 0;
- arrGarage[garageid][b_fExteriorPos][1] = 0;
- arrGarage[garageid][b_fExteriorPos][2] = 0;
- arrGarage[garageid][b_iPickupID] = 0;
- arrGarage[garageid][b_fExteriorPos][3] = 0;
- arrGarage[garageid][b_fInteriorPos][0] = 0;
- arrGarage[garageid][b_fInteriorPos][1] = 0;
- arrGarage[garageid][b_fInteriorPos][2] = 0;
- arrGarage[garageid][b_fInteriorPos][3] = 0;
- SaveGarages();
- format(string, sizeof(string), "You have deleted Business %d.", garageid);
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- }
- else if(strcmp(choice, "price", true) == 0)
- {
- arrGarage[garageid][b_iValue] = amount;
- format(string, sizeof(string), "You have set the business's price to $%d.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- if(isnull(arrGarage[garageid][b_szOwner]))
- {
- format(string, sizeof(string), "{E8A831}This garage is for sale for $%d!\n{33AA33}/buygarage to purchase.\nID: %d", arrGarage[garageid][b_iValue], garageid);
- UpdateDynamic3DTextLabelText(arrGarage[garageid][b_tLabelID], COLOR_GREEN, string);
- }
- }
- if(isnull(arrGarage[garageid][b_szOwner]))
- {
- format(string, sizeof(string), "{E8A831}This Garage is for sale for $%d!\n{33AA33}/buygarage to purchase.\nID: %d", arrGarage[garageid][b_iValue], garageid);
- UpdateDynamic3DTextLabelText(arrGarage[garageid][b_tLabelID], COLOR_GREEN, string);
- }
- return 1;
- }
- CMD:bizedit(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You are not authorized to use that command!");
- return 1;
- }
- new string[128], choice[32], bizid, amount;
- new lockedinfo[20];
- if(arrBusinessData[bizid][b_iLocked] == 0)
- { lockedinfo = "Open"; }
- if(arrBusinessData[bizid][b_iLocked] == 1)
- { lockedinfo = "Closed"; }
- else { lockedinfo = "Open"; }
- if(sscanf(params, "s[32]dD(0)", choice, bizid, amount))
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bizedit [name] [bizid] [optional amount]");
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Commands: Exterior | Interior | Vault | Type | Price | Delete | Supplies");
- return 1;
- }
- else if(strcmp(choice, "exterior", true) == 0)
- {
- GetPlayerPos(playerid, arrBusinessData[bizid][b_fExteriorPos][0], arrBusinessData[bizid][b_fExteriorPos][1], arrBusinessData[bizid][b_fExteriorPos][2]);
- GetPlayerFacingAngle(playerid, arrBusinessData[bizid][b_fExteriorPos][3]);
- SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the exterior for this business!" );
- DestroyDynamicPickup(arrBusinessData[bizid][b_iPickupID]);
- SaveBusiness();
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- DestroyDynamicPickup(arrBusinessData[bizid][b_iPickupID]);
- DestroyDynamic3DTextLabel(arrBusinessData[bizid][b_tLabelID]);
- format(string, sizeof(string), "{E8A831}This business is for sale for $%d!\n{33AA33}/buybiz to purchase.\nID: %d", arrBusinessData[bizid][b_iValue], bizid);
- arrBusinessData[bizid][b_tLabelID] = CreateDynamic3DTextLabel(string, COLOR_GREEN, arrBusinessData[bizid][b_fExteriorPos][0], arrBusinessData[bizid][b_fExteriorPos][1], arrBusinessData[bizid][b_fExteriorPos][2]+0.5,30.0, .testlos = 1, .streamdistance = 30.0, .worldid = 0, .interiorid = 0);
- arrBusinessData[bizid][b_iPickupID] = CreateDynamicPickup(1239, 23, arrBusinessData[bizid][b_fExteriorPos][0], arrBusinessData[bizid][b_fExteriorPos][1], arrBusinessData[bizid][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- }
- }
- if(strcmp(choice, "interior", true) == 0)
- {
- GetPlayerPos(playerid, arrBusinessData[bizid][b_fInteriorPos][0], arrBusinessData[bizid][b_fInteriorPos][1], arrBusinessData[bizid][b_fInteriorPos][2]);
- GetPlayerFacingAngle(playerid, arrBusinessData[bizid][b_fInteriorPos][3]);
- arrBusinessData[bizid][b_iInteriorID] = GetPlayerInterior(playerid);
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the interior for the business!");
- SaveBusiness();
- return 1;
- }
- if(strcmp(choice, "vault", true) == 0)
- {
- arrBusinessData[bizid][b_iSafeMoney] = amount;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the vault amount for that business!" );
- SaveBusiness();
- return 1;
- }
- if(strcmp(choice, "247", true) == 0)
- {
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Business must have an owner before setting the type!");
- }
- else
- {
- arrBusinessData[bizid][b_iType] = 1;
- arrBusinessData[bizid][b_iInteriorID] = 17;
- arrBusinessData[bizid][b_fInteriorPos][0] = -25.8577;
- arrBusinessData[bizid][b_fInteriorPos][1] = -187.6881;
- arrBusinessData[bizid][b_fInteriorPos][2] = 1003.8469;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the business to a 24/7 Store!" );
- format(string, sizeof(string), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(bizid), ((arrBusinessData[bizid][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[bizid][b_szOwner], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- SaveBusiness();
- }
- return 1;
- }
- if(strcmp(choice, "gunstore", true) == 0)
- {
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Business must have an owner before setting the type!");
- }
- else
- {
- arrBusinessData[bizid][b_iType] = 2;
- arrBusinessData[bizid][b_iInteriorID] = 7;
- arrBusinessData[bizid][b_fInteriorPos][0] = 315.7450;
- arrBusinessData[bizid][b_fInteriorPos][1] = -143.1594;
- arrBusinessData[bizid][b_fInteriorPos][2] = 999.6016;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the business to a Gun Store!" );
- format(string, sizeof(string), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(bizid), ((arrBusinessData[bizid][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[bizid][b_szOwner], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- SaveBusiness();
- }
- return 1;
- }
- if(strcmp(choice, "clotheshop", true) == 0)
- {
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Business must have an owner before setting the type!");
- }
- else
- {
- arrBusinessData[bizid][b_iType] = 3;
- arrBusinessData[bizid][b_iInteriorID] = 5;
- arrBusinessData[bizid][b_fInteriorPos][0] = 226.2339;
- arrBusinessData[bizid][b_fInteriorPos][1] = -8.1422;
- arrBusinessData[bizid][b_fInteriorPos][2] = 1002.2109;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the business to a Clothing Store!" );
- format(string, sizeof(string), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(bizid), ((arrBusinessData[bizid][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[bizid][b_szOwner], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- SaveBusiness();
- }
- return 1;
- }
- if(strcmp(choice, "bar", true) == 0)
- {
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Business must have an owner before setting the type!");
- }
- else
- {
- arrBusinessData[bizid][b_iType] = 4;
- arrBusinessData[bizid][b_iInteriorID] = 11;
- arrBusinessData[bizid][b_fInteriorPos][0] = 501.8307;
- arrBusinessData[bizid][b_fInteriorPos][1] = -68.0945;
- arrBusinessData[bizid][b_fInteriorPos][2] = 998.7578;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the business to a Bar!" );
- format(string, sizeof(string), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(bizid), ((arrBusinessData[bizid][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[bizid][b_szOwner], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- SaveBusiness();
- }
- return 1;
- }
- if(strcmp(choice, "electronicstore", true) == 0)
- {
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Business must have an owner before setting the type!");
- }
- else
- {
- arrBusinessData[bizid][b_iType] = 5;
- arrBusinessData[bizid][b_iInteriorID] = 6;
- arrBusinessData[bizid][b_fInteriorPos][0] = -2240.468505;
- arrBusinessData[bizid][b_fInteriorPos][1] = 137.060440;
- arrBusinessData[bizid][b_fInteriorPos][2] = 1035.414062;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the business to an Electronic Store!" );
- format(string, sizeof(string), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(bizid), ((arrBusinessData[bizid][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[bizid][b_szOwner], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- SaveBusiness();
- }
- return 1;
- }
- if(strcmp(choice, "hotel", true) == 0)
- {
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Business must have an owner before setting the type!");
- }
- else
- {
- arrBusinessData[bizid][b_iType] = 6;
- arrBusinessData[bizid][b_iInteriorID] = 15;
- arrBusinessData[bizid][b_fInteriorPos][0] = 2214.7585;
- arrBusinessData[bizid][b_fInteriorPos][1] = -1150.5792;
- arrBusinessData[bizid][b_fInteriorPos][2] = 1026.1969;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the business to a Hotel!");
- format(string, sizeof(string), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(bizid), ((arrBusinessData[bizid][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[bizid][b_szOwner], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- SaveBusiness();
- }
- return 1;
- }
- if(strcmp(choice, "restaurant", true) == 0)
- {
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Business must have an owner before setting the type!");
- }
- else
- {
- arrBusinessData[bizid][b_iType] = 7;
- arrBusinessData[bizid][b_iInteriorID] = 1;
- arrBusinessData[bizid][b_fInteriorPos][0] = 453.5935;
- arrBusinessData[bizid][b_fInteriorPos][1] = -18.2448;
- arrBusinessData[bizid][b_fInteriorPos][2] = 1001.4328;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the business to a Restaurant!");
- format(string, sizeof(string), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(bizid), ((arrBusinessData[bizid][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[bizid][b_szOwner], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- SaveBusiness();
- }
- return 1;
- }
- if(strcmp(choice, "fastfood", true) == 0)
- {
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Business must have an owner before setting the type!");
- }
- else
- {
- arrBusinessData[bizid][b_iType] = 8;
- arrBusinessData[bizid][b_iInteriorID] = 10;
- arrBusinessData[bizid][b_fInteriorPos][0] = 363.2538;
- arrBusinessData[bizid][b_fInteriorPos][1] = -74.9876;
- arrBusinessData[bizid][b_fInteriorPos][2] = 1001.7078;
- SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the business to a Fast Food Store!");
- format(string, sizeof(string), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(bizid), ((arrBusinessData[bizid][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[bizid][b_szOwner], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- SaveBusiness();
- }
- return 1;
- }
- if(strcmp(choice, "type", true) == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "There are 5 different types of businesses, they are listed below.");
- SendClientMessage(playerid, COLOR_WHITE, "24/7 - Use /bizedit 247 [bizid] to set the bizid to a 24/7 Store.");
- SendClientMessage(playerid, COLOR_WHITE, "Gun Shop - Use /bizedit gunstore [bizid] to set the bizid to a Gun Store.");
- SendClientMessage(playerid, COLOR_WHITE, "Clothing Store - Use /bizedit clotheshop [bizid] to set the bizid to a Clothes Shop.");
- SendClientMessage(playerid, COLOR_WHITE, "Bar - Use /bizedit bar [bizid] to set the bizid to a Bar.");
- SendClientMessage(playerid, COLOR_WHITE, "Electronic Store - Use /bizedit electronicstore [bizid] to set the bizid to a Electronic Store.");
- SendClientMessage(playerid, COLOR_WHITE, "Hotel - Use /bizedit hotel [bizid] to set the bizid to a Hotel.");
- SendClientMessage(playerid, COLOR_WHITE, "Restaurant - Use /bizedit restaurant [bizid] to set the bizid to a Restaurant.");
- SendClientMessage(playerid, COLOR_WHITE, "Fast Food Shack - Use /bizedit fastfood [bizid] to set the bizid to a Fast Food Shack.");
- return 1;
- }
- else if(strcmp(choice, "delete", true) == 0)
- {
- if(IsValidDynamicPickup(arrBusinessData[bizid][b_iPickupID])) DestroyDynamicPickup(arrBusinessData[bizid][b_iPickupID]);
- DestroyDynamic3DTextLabel(arrBusinessData[bizid][b_tLabelID]);
- arrBusinessData[bizid][b_fExteriorPos][0] = 0;
- arrBusinessData[bizid][b_fExteriorPos][1] = 0;
- arrBusinessData[bizid][b_fExteriorPos][2] = 0;
- arrBusinessData[bizid][b_iPickupID] = 0;
- arrBusinessData[bizid][b_fExteriorPos][3] = 0;
- arrBusinessData[bizid][b_fInteriorPos][0] = 0;
- arrBusinessData[bizid][b_fInteriorPos][1] = 0;
- arrBusinessData[bizid][b_fInteriorPos][2] = 0;
- arrBusinessData[bizid][b_fInteriorPos][3] = 0;
- SaveBusiness();
- format(string, sizeof(string), "You have deleted Business %d.", bizid);
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- }
- else if(strcmp(choice, "price", true) == 0)
- {
- arrBusinessData[bizid][b_iValue] = amount;
- format(string, sizeof(string), "You have set the business's price to $%d.", amount);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- format(string, sizeof(string), "{E8A831}This business is for sale for $%d!\n{33AA33}/buybiz to purchase.\nID: %d", arrBusinessData[bizid][b_iValue], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- }
- }
- else if(strcmp(choice, "supplies", true) == 0)
- {
- format(string, sizeof(string), "You have changed that business's amount of supplies to %d.", amount);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- arrBusinessData[bizid][b_iSupplies] = amount;
- }
- if(isnull(arrBusinessData[bizid][b_szOwner]))
- {
- format(string, sizeof(string), "{E8A831}This business is for sale for $%d!\n{33AA33}/buybiz to purchase.\nID: %d", arrBusinessData[bizid][b_iValue], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, string);
- }
- return 1;
- }
- CMD:buybiz(playerid, params[]) {
- new string[128];
- new playername[MAX_PLAYER_NAME];
- new sendername[MAX_PLAYER_NAME];
- new Float:oldposx, Float:oldposy, Float:oldposz;
- GetPlayerName(playerid, playername, sizeof(playername));
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- if(IsPlayerInRangeOfPoint(playerid, 100.0, 1109.0, 1537.0, 5.0) && PlayerInfo[playerid][pAdmin] < 2) {
- SendClientMessage(playerid, COLOR_WHITE, "You cannot use this command in this area!");
- }
- else for(new b = 0; b < MAX_BUSINESSES; b++) if(IsPlayerInRangeOfPoint(playerid,2.0, arrBusinessData[b][b_fExteriorPos][0], arrBusinessData[b][b_fExteriorPos][1], arrBusinessData[b][b_fExteriorPos][2])) {
- if(isnull(arrBusinessData[b][b_szOwner])) {
- if(PlayerInfo[playerid][pCash] > arrBusinessData[b][b_iValue]) {
- if(PlayerInfo[playerid][pPbizkey] == INVALID_BIZ_ID) {
- new
- szMessage[128];
- //-> They own the business! Just collect their name in b_szOwner to declare its ownership.
- GetPlayerName(playerid, arrBusinessData[b][b_szOwner], MAX_PLAYER_NAME);
- PlayerInfo[playerid][pPbizkey] = b;
- BizOwners++;
- GivePlayerCash(playerid, -arrBusinessData[b][b_iValue]);
- GameTextForPlayer(playerid, "~w~Congratulations!", 5000, 3);
- SendClientMessageEx(playerid, COLOR_WHITE, "Congratulations on your new purchase!");
- SendClientMessageEx(playerid, COLOR_WHITE, "You can use /bizhelp to navigate your way!");
- arrBusinessData[playerid][b_iEmployeeRank] = 5;
- SaveUser(playerid);
- DestroyDynamicPickup(arrBusinessData[b][b_iPickupID]);
- arrBusinessData[b][b_iPickupID] = CreateDynamicPickup(1239, 23, arrBusinessData[b][b_fExteriorPos][0], arrBusinessData[b][b_fExteriorPos][1], arrBusinessData[b][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- format(szMessage, sizeof(szMessage), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(b), ((arrBusinessData[b][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[b][b_szOwner], b);
- UpdateDynamic3DTextLabelText(arrBusinessData[b][b_tLabelID], COLOR_GREEN, szMessage);
- format(string, sizeof(string), "BUSINESS'S(biz1): %s has purchased business ID %i.", GetPlayerNameEx(playerid), b);
- Log("logs/transactions.log", string);
- return SaveBusiness();
- }
- if(PlayerInfo[playerid][pPbizkey2] == INVALID_BIZ_ID) {
- new
- szMessage[128];
- //-> They own the business! Just collect their name in b_szOwner to declare its ownership.
- GetPlayerName(playerid, arrBusinessData[b][b_szOwner], MAX_PLAYER_NAME);
- PlayerInfo[playerid][pPbizkey2] = b;
- GivePlayerCash(playerid, -arrBusinessData[b][b_iValue]);
- GameTextForPlayer(playerid, "~w~Congratulations!", 5000, 3);
- SendClientMessageEx(playerid, COLOR_WHITE, "Congratulations on your new purchase!");
- arrBusinessData[playerid][b_iEmployee] = 5;
- SaveUser(playerid);
- DestroyDynamicPickup(arrBusinessData[b][b_iPickupID]);
- arrBusinessData[b][b_iPickupID] = CreateDynamicPickup(1239, 23, arrBusinessData[b][b_fExteriorPos][0], arrBusinessData[b][b_fExteriorPos][1], arrBusinessData[b][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- format(szMessage, sizeof(szMessage), "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(b), ((arrBusinessData[b][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[b][b_szOwner], b);
- UpdateDynamic3DTextLabelText(arrBusinessData[b][b_tLabelID], COLOR_GREEN, szMessage);
- format(string, sizeof(string), "BUSINESS'S(biz2): %s has purchased business ID %i.", GetPlayerNameEx(playerid), b);
- Log("logs/transactions.log", string);
- return SaveBusiness();
- }
- SendClientMessageEx(playerid, COLOR_LIGHTRED, "You already own two businesses!");
- }
- else SendClientMessageEx(playerid, COLOR_LIGHTRED, "You don't have the cash to buy this business!");
- }
- else SendClientMessageEx(playerid, COLOR_LIGHTRED, "This business is already owned!");
- }
- return 1;
- }
- CMD:sellbiz(playerid, params[])
- {
- new string[128];
- new bizkey = PlayerInfo[playerid][pPbizkey];
- new bizkey2 = PlayerInfo[playerid][pPbizkey2];
- if(bizkey == INVALID_BIZ_ID && bizkey2 == INVALID_BIZ_ID)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You don't own a business!");
- return 1;
- }
- if(bizkey != INVALID_BIZ_ID && IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey][b_fExteriorPos][0],arrBusinessData[bizkey][b_fExteriorPos][1],arrBusinessData[bizkey][b_fExteriorPos][2]))
- {
- arrBusinessData[bizkey][b_iSafeMoney] = 0;
- arrBusinessData[bizkey][b_iLocked] = 1;
- arrBusinessData[bizkey][b_szOwner][0] = 0;
- GivePlayerCash(playerid,arrBusinessData[bizkey][b_iValue]);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- arrBusinessData[playerid][b_iEmployee] = -1;
- arrBusinessData[playerid][b_iEmployeeRank] = 0;
- format(string, sizeof(string), "~w~ You have sold your business for ~n~~g~$%d", arrBusinessData[bizkey][b_iValue]);
- GameTextForPlayer(playerid, string, 4000, 3);
- BizOwners--;
- PlayerInfo[playerid][pPbizkey] = INVALID_BIZ_ID;
- if(PlayerInfo[playerid][pVW] == bizkey+6000)
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,arrBusinessData[bizkey][b_fExteriorPos][0],arrBusinessData[bizkey][b_fExteriorPos][1],arrBusinessData[bizkey][b_fExteriorPos][2]);
- PlayerInfo[playerid][pVW] = 0;
- PlayerInfo[playerid][pPbizkey] = INVALID_BIZ_ID;
- }
- SaveBusiness();
- SaveUser(playerid);
- DestroyDynamicPickup(arrBusinessData[bizkey][b_iPickupID]);
- arrBusinessData[bizkey][b_iPickupID] = CreateDynamicPickup(1239, 23, arrBusinessData[bizkey][b_fExteriorPos][0], arrBusinessData[bizkey][b_fExteriorPos][1], arrBusinessData[bizkey][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- DestroyDynamic3DTextLabel(arrBusinessData[bizkey][b_tLabelID]);
- format(string, sizeof(string), "{E8A831}This business is for sale for $%d!\n{33AA33}/buybiz to purchase.\nID: %d", arrBusinessData[bizkey][b_iValue], bizkey);
- arrBusinessData[bizkey][b_tLabelID] = CreateDynamic3DTextLabel(string, COLOR_GREEN, arrBusinessData[bizkey][b_fExteriorPos][0], arrBusinessData[bizkey][b_fExteriorPos][1], arrBusinessData[bizkey][b_fExteriorPos][2]+0.5, 30.0, .testlos = 1, .streamdistance = 30.0, .worldid = 0, .interiorid = 0);
- format(string, sizeof(string), "BUSINESS'S(biz1): %s has sold there business, business ID: %i.", GetPlayerNameEx(playerid), bizkey);
- Log("logs/transactions.log", string);
- return 1;
- }
- else if(bizkey2 != INVALID_BIZ_ID && IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey2][b_fExteriorPos][0],arrBusinessData[bizkey2][b_fExteriorPos][1],arrBusinessData[bizkey2][b_fExteriorPos][2]))
- {
- arrBusinessData[bizkey2][b_iSafeMoney] = 0;
- arrBusinessData[bizkey2][b_iLocked] = 1;
- arrBusinessData[bizkey2][b_szOwner][0] = 0;
- GivePlayerCash(playerid,arrBusinessData[bizkey2][b_iValue]);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~Congratulations~n~ You have sold your property for ~n~~g~$%d", arrBusinessData[bizkey2][b_iValue]);
- GameTextForPlayer(playerid, string, 4000, 3);
- BizOwners--;
- PlayerInfo[playerid][pPbizkey2] = INVALID_BIZ_ID;
- if(PlayerInfo[playerid][pVW] == bizkey2+6000)
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,arrBusinessData[bizkey2][b_fExteriorPos][0],arrBusinessData[bizkey2][b_fExteriorPos][1],arrBusinessData[bizkey2][b_fExteriorPos][2]);
- PlayerInfo[playerid][pVW] = 0;
- PlayerInfo[playerid][pPbizkey2] = INVALID_BIZ_ID;
- }
- SaveBusiness();
- SaveUser(playerid);
- DestroyDynamicPickup(arrBusinessData[bizkey2][b_iPickupID]);
- arrBusinessData[bizkey2][b_iPickupID] = CreateDynamicPickup(1239, 23, arrBusinessData[bizkey2][b_fExteriorPos][0], arrBusinessData[bizkey2][b_fExteriorPos][1], arrBusinessData[bizkey2][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- DestroyDynamic3DTextLabel(arrBusinessData[bizkey2][b_tLabelID]);
- format(string, sizeof(string), "{E8A831}This business is for sale for $%d!\n{33AA33}/buybiz to purchase.\nID: %d", arrBusinessData[bizkey2][b_iValue], bizkey2);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizkey2][b_tLabelID], COLOR_GREEN, string);
- format(string, sizeof(string), "BUSINESS'S(biz2): %s has sold there business, business ID: %i.", GetPlayerNameEx(playerid), bizkey2);
- Log("logs/transactions.log", string);
- return 1;
- }
- return 1;
- }
- CMD:buygarage(playerid, params[])
- {
- new string[128];
- if(IsPlayerInRangeOfPoint(playerid, 100.0, 1109.0, 1537.0, 5.0) && PlayerInfo[playerid][pAdmin] < 2) {
- SendClientMessage(playerid, COLOR_WHITE, "You cannot use this command in this area!");
- }
- else for(new b = 0; b < MAX_GARAGES; b++) if(IsPlayerInRangeOfPoint(playerid,2.0, arrGarage[b][b_fExteriorPos][0], arrGarage[b][b_fExteriorPos][1], arrGarage[b][b_fExteriorPos][2])) {
- if(isnull(arrGarage[b][b_szOwner])) {
- if(PlayerInfo[playerid][pCash] > arrGarage[b][b_iValue]) {
- if(PlayerInfo[playerid][pPgaragekey] == INVALID_GARAGE_ID) {
- new
- szMessage[128];
- //-> They own the business! Just collect their name in b_szOwner to declare its ownership.
- GetPlayerName(playerid, arrGarage[b][b_szOwner], MAX_PLAYER_NAME);
- PlayerInfo[playerid][pPgaragekey] = b;
- BizOwners++;
- GivePlayerCash(playerid, -arrGarage[b][b_iValue]);
- GameTextForPlayer(playerid, "~w~Congratulations!", 5000, 3);
- SendClientMessageEx(playerid, COLOR_WHITE, "Congratulations on your new purchase!");
- SendClientMessageEx(playerid, COLOR_WHITE, "You can use /garagehelp to navigate your way!");
- SaveUser(playerid);
- DestroyDynamicPickup(arrGarage[b][b_iPickupID]);
- arrGarage[b][b_iPickupID] = CreateDynamicPickup(1239, 23, arrGarage[b][b_fExteriorPos][0], arrGarage[b][b_fExteriorPos][1], arrGarage[b][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- format(szMessage, sizeof(szMessage), "Garage\n\nStatus: %s\nOwned by %s\n\nID: %d",((arrGarage[b][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrGarage[b][b_szOwner], b);
- UpdateDynamic3DTextLabelText(arrGarage[b][b_tLabelID], COLOR_GREEN, szMessage);
- format(string, sizeof(string), "GARAGES: %s has purchased garage ID %i.", GetPlayerNameEx(playerid), b);
- Log("logs/transactions.log", string);
- return SaveBusiness();
- }
- }
- else SendClientMessageEx(playerid, COLOR_LIGHTRED, "You don't have the cash to buy this garage!");
- }
- else SendClientMessageEx(playerid, COLOR_LIGHTRED, "This garage is already owned!");
- }
- return 1;
- }
- CMD:sellgarage(playerid, params[])
- {
- new string[128];
- new garagekey = PlayerInfo[playerid][pPgaragekey];
- if(garagekey == INVALID_GARAGE_ID)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You don't own a garage!");
- return 1;
- }
- if(garagekey != INVALID_GARAGE_ID && IsPlayerInRangeOfPoint(playerid, 4.0,arrGarage[garagekey][b_fExteriorPos][0],arrGarage[garagekey][b_fExteriorPos][1],arrGarage[garagekey][b_fExteriorPos][2]))
- {
- arrGarage[garagekey][b_iSafeMoney] = 0;
- arrGarage[garagekey][b_iLocked] = 1;
- arrGarage[garagekey][b_szOwner][0] = 0;
- GivePlayerCash(playerid,arrGarage[garagekey][b_iValue]);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~ You have sold your garage for ~n~~g~$%d", arrGarage[garagekey][b_iValue]);
- GameTextForPlayer(playerid, string, 4000, 3);
- PlayerInfo[playerid][pPgaragekey] = INVALID_BIZ_ID;
- if(PlayerInfo[playerid][pVW] == garagekey+6000)
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,arrGarage[garagekey][b_fExteriorPos][0],arrGarage[garagekey][b_fExteriorPos][1],arrGarage[garagekey][b_fExteriorPos][2]);
- PlayerInfo[playerid][pVW] = 0;
- PlayerInfo[playerid][pPgaragekey] = INVALID_GARAGE_ID;
- }
- SaveGarages();
- SaveUser(playerid);
- format(string, sizeof(string), "GARAGES: %s has sold there garage.", GetPlayerNameEx(playerid));
- Log("logs/transactions.log", string);
- DestroyDynamicPickup(arrGarage[garagekey][b_iPickupID]);
- arrGarage[garagekey][b_iPickupID] = CreateDynamicPickup(1239, 23, arrGarage[garagekey][b_fExteriorPos][0], arrGarage[garagekey][b_fExteriorPos][1], arrGarage[garagekey][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- DestroyDynamic3DTextLabel(arrGarage[garagekey][b_tLabelID]);
- format(string, sizeof(string), "{E8A831}This Garage is for sale for $%d!\n{33AA33}/buygarage to purchase.\nID: %d", arrGarage[garagekey][b_iValue], garagekey);
- arrGarage[garagekey][b_tLabelID] = CreateDynamic3DTextLabel(string, COLOR_GREEN, arrGarage[garagekey][b_fExteriorPos][0], arrGarage[garagekey][b_fExteriorPos][1], arrGarage[garagekey][b_fExteriorPos][2]+0.5, 30.0, .testlos = 1, .streamdistance = 30.0, .worldid = 0, .interiorid = 0);
- return 1;
- }
- return 1;
- }
- CMD:lockbiz(playerid, params[])
- {
- new
- iBusinessID = PlayerInfo[playerid][pPbizkey];
- if(0 <= iBusinessID < MAX_BUSINESSES && (IsPlayerInRangeOfPoint(playerid, 2.0, arrBusinessData[iBusinessID][b_fExteriorPos][0], arrBusinessData[iBusinessID][b_fExteriorPos][1], arrBusinessData[iBusinessID][b_fExteriorPos][2]) || IsPlayerInRangeOfPoint(playerid, 2.0, arrBusinessData[iBusinessID][b_fInteriorPos][0], arrBusinessData[iBusinessID][b_fInteriorPos][1], arrBusinessData[iBusinessID][b_fInteriorPos][2]))) {
- new
- szMessage[128];
- if(arrBusinessData[iBusinessID][b_iLocked]) {
- arrBusinessData[iBusinessID][b_iLocked] = 0;
- format(szMessage, sizeof(szMessage), "* %s has unlocked their business.", GetPlayerNameEx(playerid));
- }
- else {
- arrBusinessData[iBusinessID][b_iLocked] = 1;
- format(szMessage, sizeof(szMessage), "* %s has locked their business.", GetPlayerNameEx(playerid));
- }
- ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- DestroyDynamicPickup(arrBusinessData[iBusinessID][b_iPickupID]);
- arrBusinessData[iBusinessID][b_iPickupID] = CreateDynamicPickup(1239, 23, arrBusinessData[iBusinessID][b_fExteriorPos][0], arrBusinessData[iBusinessID][b_fExteriorPos][1], arrBusinessData[iBusinessID][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- format(szMessage, sizeof szMessage, "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(iBusinessID), ((arrBusinessData[iBusinessID][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[iBusinessID][b_szOwner], iBusinessID);
- return UpdateDynamic3DTextLabelText(arrBusinessData[iBusinessID][b_tLabelID], COLOR_GREEN, szMessage);
- }
- else iBusinessID = PlayerInfo[playerid][pPbizkey2];
- if(0 <= iBusinessID < MAX_BUSINESSES && (IsPlayerInRangeOfPoint(playerid, 2.0, arrBusinessData[iBusinessID][b_fExteriorPos][0], arrBusinessData[iBusinessID][b_fExteriorPos][1], arrBusinessData[iBusinessID][b_fExteriorPos][2]) || IsPlayerInRangeOfPoint(playerid, 2.0, arrBusinessData[iBusinessID][b_fInteriorPos][0], arrBusinessData[iBusinessID][b_fInteriorPos][1], arrBusinessData[iBusinessID][b_fInteriorPos][2]))) {
- new
- szMessage[128];
- if(arrBusinessData[iBusinessID][b_iLocked]) {
- arrBusinessData[iBusinessID][b_iLocked] = 0;
- format(szMessage, sizeof(szMessage), "* %s has unlocked their business.", GetPlayerNameEx(playerid));
- }
- else {
- arrBusinessData[iBusinessID][b_iLocked] = 1;
- format(szMessage, sizeof(szMessage), "* %s has locked their business.", GetPlayerNameEx(playerid));
- }
- ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- DestroyDynamicPickup(arrBusinessData[iBusinessID][b_iPickupID]);
- arrBusinessData[iBusinessID][b_iPickupID] = CreateDynamicPickup(1239, 23, arrBusinessData[iBusinessID][b_fExteriorPos][0], arrBusinessData[iBusinessID][b_fExteriorPos][1], arrBusinessData[iBusinessID][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- format(szMessage, sizeof szMessage, "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(iBusinessID), ((arrBusinessData[iBusinessID][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[iBusinessID][b_szOwner], iBusinessID);
- return UpdateDynamic3DTextLabelText(arrBusinessData[iBusinessID][b_tLabelID], COLOR_GREEN, szMessage);
- }
- return SendClientMessageEx(playerid, COLOR_WHITE, "You either don't own a business, or are not at one of them.");
- }
- CMD:lockgarage(playerid, params[])
- {
- new
- garageID = PlayerInfo[playerid][pPgaragekey];
- if(0 <= garageID < MAX_BUSINESSES && (IsPlayerInRangeOfPoint(playerid, 2.0, arrGarage[garageID][b_fExteriorPos][0], arrGarage[garageID][b_fExteriorPos][1], arrGarage[garageID][b_fExteriorPos][2]) || IsPlayerInRangeOfPoint(playerid, 2.0, arrGarage[garageID][b_fInteriorPos][0], arrGarage[garageID][b_fInteriorPos][1], arrGarage[garageID][b_fInteriorPos][2]))) {
- new
- szMessage[128];
- if(arrGarage[garageID][b_iLocked]) {
- arrGarage[garageID][b_iLocked] = 0;
- format(szMessage, sizeof(szMessage), "* %s has unlocked their garage.", GetPlayerNameEx(playerid));
- }
- else {
- arrGarage[garageID][b_iLocked] = 1;
- format(szMessage, sizeof(szMessage), "* %s has locked their garage.", GetPlayerNameEx(playerid));
- }
- ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- DestroyDynamicPickup(arrGarage[garageID][b_iPickupID]);
- arrGarage[garageID][b_iPickupID] = CreateDynamicPickup(1239, 23, arrGarage[garageID][b_fExteriorPos][0], arrGarage[garageID][b_fExteriorPos][1], arrGarage[garageID][b_fExteriorPos][2], .worldid = 0, .interiorid = 0);
- format(szMessage, sizeof(szMessage), "Garage\n\nStatus: %s\nOwned by %s\n\nID: %d",((arrGarage[garageID][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrGarage[garageID][b_szOwner], garageID);
- return UpdateDynamic3DTextLabelText(arrGarage[garageID][b_tLabelID], COLOR_GREEN, szMessage);
- }
- return SendClientMessageEx(playerid, COLOR_WHITE, "You either don't own a garage, or are not at one of them.");
- }
- CMD:garagehelp(playerid, params[])
- {
- if(PlayerInfo[playerid][pPgaragekey] > -1)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "*** Garage Help ***");
- SendClientMessage(playerid, COLOR_WHITE, "You can use your garage to park cars, hide away or host a car show and more!");
- SendClientMessage(playerid, COLOR_WHITE, "Commands: /lockgarage - /sellgarage - /buygarage - /sellmygarage");
- SendClientMessage(playerid, COLOR_GREEN, "If you have any questions or concerns, report for an administrator.");
- }
- else SendClientMessage(playerid, COLOR_WHITE, "You dont own a garage!");
- return 1;
- }
- CMD:bizhelp(playerid, params[])
- {
- if(PlayerInfo[playerid][pPbizkey] >= -1 || PlayerInfo[playerid][pPbizkey2] >= -1)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "*** Business Help ***");
- SendClientMessage(playerid, COLOR_WHITE, "As a Business Owner you are expected to maintain and run your business with high standards.");
- SendClientMessage(playerid, COLOR_WHITE, "Your very lucky you own a business, you are able to deposit money into your safe as well as withdraw it.");
- SendClientMessage(playerid, COLOR_WHITE, "You must report for a HA+ to change the type of your business, depending if the type has been setup, you will be fined %10 total wealth.");
- SendClientMessage(playerid, COLOR_WHITE, "Commands: /lockbiz - /sellbiz - /buybiz - /bizdeposit - /bizwithdraw - /bizvault - /bchat - /bizcontract - /bizterminate - /bgiverank");
- SendClientMessage(playerid, COLOR_GREEN, "If you have any questions or concerns, report for an administrator.");
- }
- else SendClientMessage(playerid, COLOR_WHITE, "You dont own a business!");
- return 1;
- }
- CMD:bizvault(playerid, params[])
- {
- new string[128];
- new bizid;
- new bizkey = PlayerInfo[playerid][pPbizkey];
- new bizkey2 = PlayerInfo[playerid][pPbizkey2];
- if(PlayerInfo[playerid][pPbizkey] > -1 || PlayerInfo[playerid][pPbizkey2] > -1)
- {
- if(bizkey != INVALID_BIZ_ID && IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey][b_fInteriorPos][0],arrBusinessData[bizkey][b_fInteriorPos][1],arrBusinessData[bizkey][b_fInteriorPos][2]) || bizkey2 != INVALID_BIZ_ID && IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey2][b_fInteriorPos][0],arrBusinessData[bizkey2][b_fInteriorPos][1],arrBusinessData[bizkey2][b_fInteriorPos][2]))
- {
- SendClientMessage(playerid, COLOR_GREEN, "|___| Business Vault |___|");
- format(string, sizeof(string), "Your current vault amount is: $%i.", arrBusinessData[bizid][b_iSafeMoney]);
- SendClientMessageToAll(COLOR_LIGHTRED, string);
- SendClientMessage(playerid, COLOR_GREEN, "|________________________|");
- }
- else SendClientMessage(playerid, COLOR_WHITE, "You are not inside your business or you dont own one!");
- }
- return 1;
- }
- CMD:bizdeposit(playerid, params[])
- {
- new string[128];
- new bizid, amount = arrBusinessData[bizid][b_iSafeMoney];
- new bizkey = PlayerInfo[playerid][pPbizkey];
- new bizkey2 = PlayerInfo[playerid][pPbizkey2];
- if(PlayerInfo[playerid][pPbizkey] > -1 || PlayerInfo[playerid][pPbizkey2] > -1)
- {
- if(bizkey != INVALID_BIZ_ID && IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey][b_fInteriorPos][0],arrBusinessData[bizkey][b_fInteriorPos][1],arrBusinessData[bizkey][b_fInteriorPos][2]) || bizkey2 != INVALID_BIZ_ID && IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey2][b_fInteriorPos][0],arrBusinessData[bizkey2][b_fInteriorPos][1],arrBusinessData[bizkey2][b_fInteriorPos][2]))
- {
- if(sscanf(params, "d", amount)) {
- return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bizdeposit [amount]");
- }
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You must deposit atleast $1!");
- if(amount > 1)
- GivePlayerCash(playerid, -amount);
- arrBusinessData[bizid][b_iSafeMoney] += amount;
- format(string, sizeof(string), "You have deposited $%i into your business!", amount);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
- format(string, sizeof(string), "BUSINESS'S: %s has deposited $%i to his business vault.", GetPlayerNameEx(playerid), amount);
- Log("logs/transactions.log", string);
- SaveUser(playerid);
- SaveBusiness();
- }
- else SendClientMessage(playerid, COLOR_WHITE, "You are not inside your business!");
- }
- else SendClientMessage(playerid, COLOR_WHITE, "You dont own a business!");
- return 1;
- }
- CMD:bizwithdraw(playerid, params[])
- {
- new string[128];
- new bizid, amount = arrBusinessData[bizid][b_iSafeMoney];
- new bizkey = PlayerInfo[playerid][pPbizkey];
- new bizkey2 = PlayerInfo[playerid][pPbizkey2];
- if(PlayerInfo[playerid][pPbizkey] > -1 || PlayerInfo[playerid][pPbizkey2] > -1)
- {
- if(bizkey != INVALID_BIZ_ID && IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey][b_fInteriorPos][0],arrBusinessData[bizkey][b_fInteriorPos][1],arrBusinessData[bizkey][b_fInteriorPos][2]) || bizkey2 != INVALID_BIZ_ID && IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey2][b_fInteriorPos][0],arrBusinessData[bizkey2][b_fInteriorPos][1],arrBusinessData[bizkey2][b_fInteriorPos][2]))
- {
- if(sscanf(params, "d", amount)) {
- return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bizwithdraw [amount]");
- }
- if(amount < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You must withdraw atleast $1!");
- if(amount > 1)
- if(arrBusinessData[bizid][b_iSafeMoney] > amount)
- {
- GivePlayerCash(playerid, amount);
- arrBusinessData[bizid][b_iSafeMoney] -= amount;
- format(string, sizeof(string), "You have withdraw $%i from your business!", amount);
- SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
- format(string, sizeof(string), "BUSINESS'S: %s has withdrawn $%i from his business vault.", GetPlayerNameEx(playerid), amount);
- Log("logs/transactions.log", string);
- }
- }
- else SendClientMessage(playerid, COLOR_WHITE, "You are not near your business!");
- }
- else SendClientMessage(playerid, COLOR_WHITE, "You dont own a business!");
- return 1;
- }
- CMD:sellmybiz(playerid, params[])
- {
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- if((PlayerInfo[playerid][pPbizkey] != INVALID_BIZ_ID && strcmp(playername, arrBusinessData[PlayerInfo[playerid][pPbizkey]][b_szOwner], true) == 0) || (PlayerInfo[playerid][pPbizkey2] != INVALID_BIZ_ID && strcmp(playername, arrBusinessData[PlayerInfo[playerid][pPbizkey2]][b_szOwner], true) == 0))
- {
- new string[128], giveplayerid, price;
- if(sscanf(params, "ud", giveplayerid, price)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sellmybiz [player] [price]");
- if(price < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "The selling price must be higher than $0!");
- if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "Player is currently not connected to the server.");
- if(PlayerInfo[giveplayerid][pPbizkey] != INVALID_BIZ_ID && strcmp(GetPlayerNameEx(playerid), arrBusinessData[PlayerInfo[giveplayerid][pPbizkey]][b_szOwner], true) == 0)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "They already own a business!");
- return 1;
- }
- new bizkey = PlayerInfo[playerid][pPbizkey];
- new bizkey2 = PlayerInfo[playerid][pPbizkey2];
- if(IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey][b_fExteriorPos][0],arrBusinessData[bizkey][b_fExteriorPos][1],arrBusinessData[bizkey][b_fExteriorPos][2]))
- {
- if (ProxDetectorS(8.0, playerid, giveplayerid))
- {
- SetPVarInt(giveplayerid, "BizSeller", playerid);
- SetPVarInt(giveplayerid, "BizPrice", price);
- SetPVarInt(playerid, "BizBuyer", giveplayerid);
- SetPVarInt(playerid, "BizID", bizkey);
- format(string, sizeof(string), "* You offered %s to buy your business for $%d.", GetPlayerNameEx(giveplayerid), price);
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* %s has offered you their business for $%d, (type /accept business) to buy the business.", GetPlayerNameEx(playerid), price);
- SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
- return 1;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "That player is not near you.");
- return 1;
- }
- }
- else if(IsPlayerInRangeOfPoint(playerid, 4.0,arrBusinessData[bizkey2][b_fExteriorPos][0],arrBusinessData[bizkey2][b_fExteriorPos][1],arrBusinessData[bizkey2][b_fExteriorPos][2]))
- {
- if (ProxDetectorS(8.0, playerid, giveplayerid))
- {
- SetPVarInt(giveplayerid, "BizSeller", playerid);
- SetPVarInt(giveplayerid, "BizPrice", price);
- SetPVarInt(playerid, "BizBuyer", giveplayerid);
- SetPVarInt(playerid, "BizID", bizkey2);
- format(string, sizeof(string), "* You offered %s to buy your business for $%d.", GetPlayerNameEx(giveplayerid), price);
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* %s has offered you their business for $%d, (type /accept business) to buy the business.", GetPlayerNameEx(playerid), price);
- SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
- return 1;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "That player is not near you.");
- return 1;
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You are not near your business.");
- return 1;
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You don't own a business.");
- }
- return 1;
- }
- CMD:sellmygarage(playerid, params[])
- {
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, sizeof(playername));
- if((PlayerInfo[playerid][pPgaragekey] != INVALID_GARAGE_ID && strcmp(playername, arrGarage[PlayerInfo[playerid][pPgaragekey]][b_szOwner], true) == 0))
- {
- new string[128], giveplayerid, price;
- if(sscanf(params, "ud", giveplayerid, price)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /sellmygarage [player] [price]");
- if(price < 1) return SendClientMessageEx(playerid, COLOR_WHITE, "The selling price must be higher than $0!");
- if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "Player is currently not connected to the server.");
- if(PlayerInfo[giveplayerid][pPgaragekey] != INVALID_GARAGE_ID && strcmp(GetPlayerNameEx(playerid), arrGarage[PlayerInfo[giveplayerid][pPgaragekey]][b_szOwner], true) == 0)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "They already own a garage!");
- return 1;
- }
- new garagekey = PlayerInfo[playerid][pPgaragekey];
- if(IsPlayerInRangeOfPoint(playerid, 4.0,arrGarage[garagekey][b_fExteriorPos][0],arrGarage[garagekey][b_fExteriorPos][1],arrGarage[garagekey][b_fExteriorPos][2]))
- {
- if (ProxDetectorS(8.0, playerid, giveplayerid))
- {
- SetPVarInt(giveplayerid, "BizSeller1", playerid);
- SetPVarInt(giveplayerid, "BizPrice1", price);
- SetPVarInt(playerid, "BizBuyer1", giveplayerid);
- SetPVarInt(playerid, "BizID1", garagekey);
- format(string, sizeof(string), "* You offered %s to buy your garage for $%d.", GetPlayerNameEx(giveplayerid), price);
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* %s has offered you their garage for $%d, (type /accept garage) to buy the business.", GetPlayerNameEx(playerid), price);
- SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "That player is not near you.");
- return 1;
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You are not near your garage.");
- return 1;
- }
- }
- return 1;
- }
- CMD:updatebiz(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pShopTech] == 1)
- {
- new bizid, szText[128];
- if(sscanf(params, "d", bizid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /updatebiz [bizid]");
- if(!isnull(arrBusinessData[bizid][b_szOwner])) format(szText, sizeof szText, "%s\n%s\nOwned by %s\nID: %d", Business_ReturnType(bizid), ((arrBusinessData[bizid][b_iLocked]) ? ("{FF0000}Closed{33AA33}") : ("{E8A831}Open{33AA33}")), arrBusinessData[bizid][b_szOwner], bizid);
- else format(szText, sizeof szText, "{E8A831}This business is for sale for $%d!\n{33AA33}/buybiz to purchase.\nID: %d", arrBusinessData[bizid][b_iValue], bizid);
- UpdateDynamic3DTextLabelText(arrBusinessData[bizid][b_tLabelID], COLOR_GREEN, szText);
- SendClientMessage(playerid, COLOR_RED, "Business successfully updated.");
- }
- return 1;
- }
- CMD:buydrink(playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 30.0, 501.8307,-68.0945,998.7578))
- {
- ShowPlayerDialog(playerid, 6241, DIALOG_STYLE_LIST, "Bar Drinks!", "Vodka($18)\nWKD($14)\nSmirn-Off Ice($16)\nWhisky($20)\nCarling($7)", "Buy Drink", "Cancel");
- }
- else SendClientMessage(playerid, COLOR_WHITE, "You are not in a Bar!");
- return 1;
- }
- CMD:weplist(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Brass Knuckles | 1 - Golf Club | 2 - Nitestick | 3 - Knife | 4 - Baseball bat | 5");
- SendClientMessage(playerid, COLOR_WHITE, "Shovel | 6 - Pool Cue | 7 - Katana | 8 - Chainsaw | 9 - Double-Ended Dildo | 10 ");
- SendClientMessage(playerid, COLOR_WHITE, "Dildo | 11 - Vibrator | 12 - Silver Vibrator | 13 - Flowers | 14 - Cane | 15");
- SendClientMessage(playerid, COLOR_WHITE, "Grenade | 16 - Tear Gas | 17 - Molotov Cocktail | 18 - 9mm | 22 - Silenced 9mm | 23");
- SendClientMessage(playerid, COLOR_WHITE, "Desert Eagle | 24 - Shotgun | 25 - Sawnoff Shotgun | 26 - Combat Shotgun | 27");
- SendClientMessage(playerid, COLOR_WHITE, "Micro SMG/Uzi | 28 - MP5 | 29 - AK-47 | 30 - M4 | 31 - Tec-9 | 32 - Country Rifle | 33");
- SendClientMessage(playerid, COLOR_WHITE, "Sniper Rifle | 34 - RPG | 35 - HS Rocket | 36 - Flamethrower | 37 - Minigun | 38 ");
- SendClientMessage(playerid, COLOR_WHITE, "Satchel Charge - 39 | Detonator | 40 - Spraycan | 41 - Fire Extinguisher | 42");
- SendClientMessage(playerid, COLOR_WHITE, "Camera | 43 - Night Vis Goggles | 44 - Thermal Goggles | 45 - Parachute | 46");
- }
- return 1;
- }
- stock IsAtElecStore(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid, 40.0, -2240.468505,137.060440,1035.414062))
- {
- return 1;
- }
- }
- return 0;
- }
- stock SaveUser(playerid)
- {
- if(gPlayerLogged{playerid}) {
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement