[Help] I need help with this
#1

Hello there so i tried to make this command work while inside like if i do /lockhouse outside it locks the house but when i go inside it says your not near your house and also i want it to work the same with the business to /lockbusiness and i want it to /lockbusiness while inside

Код:
command(lockhouse, playerid, params[])
{
	#pragma unused params
	new string[128];
	if(!IsPlayerInRangeOfPoint(playerid, 5, Houses[Player[playerid][House]][hExteriorX], Houses[Player[playerid][House]][hExteriorY], Houses[Player[playerid][House]][hExteriorZ]))
	{
		 return SendClientMessage(playerid, WHITE, "You are not near a house that you own!");
	}
	if(Player[playerid][House] > 0)
	{
	    if(Houses[Player[playerid][House]][LockStatus] == 1)
	    {
	        Houses[Player[playerid][House]][LockStatus] = 0;
	        format(string, sizeof(string), "** %s has unlocked their house door.", GetName(playerid));
            NearByMessage(playerid, SCRIPTPURPLE, string);
	    }
	    else
	    {
	        Houses[Player[playerid][House]][LockStatus] = 1;
	        format(string, sizeof(string), "** %s has locked their house door.", GetName(playerid));
            NearByMessage(playerid, SCRIPTPURPLE, string);
	    }
	}
	return 1;
}
Код:
command(lockbusiness, playerid, params[])
{
	#pragma unused params
	new string[128];
	if(!IsPlayerInRangeOfPoint(playerid, 5, Businesses[Player[playerid][Business]][bExteriorX], Businesses[Player[playerid][Business]][bExteriorY], Businesses[Player[playerid][Business]][bExteriorZ]))
	{
		 return SendClientMessage(playerid, WHITE, "You are not near a business that you own!");
	}
	if(Player[playerid][Business] > 0)
	{
	    if(Businesses[Player[playerid][Business]][bLockStatus] == 1)
	    {
	        Businesses[Player[playerid][Business]][bLockStatus] = 0;
	        format(string, sizeof(string), "** %s has unlocked their business doors.", GetName(playerid));
            NearByMessage(playerid, SCRIPTPURPLE, string);
	    }
	    else
	    {
	        Businesses[Player[playerid][Business]][bLockStatus] = 1;
	        format(string, sizeof(string), "** %s has locked their business doors.", GetName(playerid));
            NearByMessage(playerid, SCRIPTPURPLE, string);
	    }
	}
	return 1;
Reply


Messages In This Thread
[Help] I need help with this - by BigGreen - 26.06.2015, 13:18
Re: [Help] I need help with this - by Prokill911 - 26.06.2015, 13:24
Re: [Help] I need help with this - by BigGreen - 26.06.2015, 13:28
Re: [Help] I need help with this - by rappy93 - 26.06.2015, 13:31
Re: [Help] I need help with this - by BigGreen - 26.06.2015, 13:33
Re: [Help] I need help with this - by Prokill911 - 26.06.2015, 13:36
Re: [Help] I need help with this - by rappy93 - 26.06.2015, 13:36
Re: [Help] I need help with this - by Prokill911 - 26.06.2015, 13:38

Forum Jump:


Users browsing this thread: 1 Guest(s)