Need Help with enterable businesses
#1

Well, I have a business system (PPC_Business) on my server, and it came with enterable businesses, but only for the owner. Now I'm pretty sure it has something to do with the /enter command, so here that is:

Код:
// This command lets the player enter the house/business if he's the owner
COMMAND:enter(playerid, params[])
{
	// If a player hasn't logged in properly, he cannot use this command
	if (INT_IsPlayerLoggedIn(playerid) == 0) return 0;

	// Setup local variables
	new BusID, BusType;

	// Make sure the player isn't inside a vehicle
	if (GetPlayerVehicleSeat(playerid) == -1)
	{
		// Loop through all player-owned businesses
		for (new BusSlot; BusSlot < MAX_BUSINESSPERPLAYER; BusSlot++)
		{
		    // Get the business-id at the selected slot from the player
		    BusID = APlayerData[playerid][Business][BusSlot];

			// Check if the player has a business in this slot
			if (BusID != 0)

			{
				// Check if the player is in range of the business-pickup
				if (IsPlayerInRangeOfPoint(playerid, 2.5, ABusinessData[BusID][BusinessX], ABusinessData[BusID][BusinessY], ABusinessData[BusID][BusinessZ]))
				{
				    // Get the business-type
				    BusType = ABusinessData[BusID][BusinessType];

					// Set the worldid so other players cannot see him anymore
					SetPlayerVirtualWorld(playerid, 2000 + BusID);
					// Set the player inside the interior of the business
					SetPlayerInterior(playerid, ABusinessInteriors[BusType][InteriorID]);
					// Set the position of the player at the spawn-location of the business's interior
					SetPlayerPos(playerid, ABusinessInteriors[BusType][IntX], ABusinessInteriors[BusType][IntY], ABusinessInteriors[BusType][IntZ]);

					// Also set a tracking-variable to enable /busmenu to track in which business the player is
					APlayerData[playerid][CurrentBusiness] = BusID;
					// Also let the player know he can use /busmenu to control his business
					SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Use {FFFF00}/busmenu{00FF00} to change options for your business");
					// Exit the function
					return 1;
				}
So I'm trying to make it so the businesses are enterable for everyone, but if you do not own the business, you can't open /busmenu.I tried doing it by myself but failed, so if you could help me it would be much appreciated!
Reply
#2

go to scriptfiles > ServerData > Business
open up one of the text files
at the very bottom of the text file it should say

Owned No/Yes
Owner (owner name would be here)

otherwise no idea what your talking about
Reply
#3

Oh my, I apologize for my retarded original post, I wanted the business to be enterable for everyone, but if you dont own it, there is no /busmenu for you.
Reply
#4

Could you post the bottom bit of that command? As well as /busmenu.
Reply
#5

That's the entire command, and here is /busmenu:
Код:
// This command opens a menu when you're inside your business to allow to access the options of your business
COMMAND:busmenu(playerid, params[])
{
	// If a player hasn't logged in properly, he cannot use this command
	if (INT_IsPlayerLoggedIn(playerid) == 0) return 0;

	// Setup local variables
	new OptionsList[200], DialogTitle[200];

	// Check if the player is inside a business
	if (APlayerData[playerid][CurrentBusiness] != 0)
	{
		// Create the dialog title
		format(DialogTitle, sizeof(DialogTitle), "Select option for %s", ABusinessData[APlayerData[playerid][CurrentBusiness]][BusinessName]);
		// Create the options in the dialog
		format(OptionsList, sizeof(OptionsList), "%sChange business-name\n", OptionsList);
		format(OptionsList, sizeof(OptionsList), "%sUpgrade business\n", OptionsList);
		format(OptionsList, sizeof(OptionsList), "%sRetrieve business earnings\n", OptionsList);
		format(OptionsList, sizeof(OptionsList), "%sSell business\n", OptionsList);
		format(OptionsList, sizeof(OptionsList), "%sExit business\n", OptionsList);
		// Show the businessmenu
		ShowPlayerDialog(playerid, DialogBusinessMenu, DIALOG_STYLE_LIST, DialogTitle, OptionsList, "Select", "Cancel");
	}
	else
	    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You're not inside a business");

	// Let the server know that this was a valid command
	return 1;
}
Reply
#6

bump
Reply
#7

bump
Reply
#8

buuumpppp
Reply
#9

pawn Код:
if (INT_IsPlayerLoggedIn(playerid) == 0) return 0;
What is "INT" doing ?!
Reply
#10

If a player hasn't logged in properly, he cannot use this command, that's what it's doing there.
Reply


Forum Jump:


Users browsing this thread: