Wanted enter don't work
#1

Hello everyone.. what is wrong with this command ?

Код:
if(strcmp(cmdtext, "/enter", true) == 0)
{
        if(GetPlayerWantedLevel(playerid) >= 1)
        {
            if PlayerToPoint(5,playerid,999.2678,-919.9958,42.1797)
            {
                SetPlayerPos(playerid,-27.312299,-29.277599,1003.557250);
                SetPlayerInterior(playerid,4);
                PlayerInfo[playerid][pInt] = 4;
                GameTextForPlayer(playerid, "~h~24/7", 5000, 1);
                return 1;
       }
       else
       {
            GameTextForPlayer(playerid, "~r~Criminals can't hide in here!", 5000, 1);
            return 1;
        }
    }
}
If i have wanted, i can enter in interior...
Reply
#2

if(GetPlayerWantedLevel(playerid) <1) xD?
Reply
#3

PHP код:
if(strcmp(cmdtext"/enter"true) == 0)
{
    if(
GetPlayerWantedLevel(playerid) < && IsPlayerInRangeOfPoint(playerid5.0,999.2678,-919.9958,42.1797))
    {
        
SetPlayerPos(playerid,-27.312299,-29.277599,1003.557250);
        
SetPlayerInterior(playerid,4);
        
PlayerInfo[playerid][pInt] = 4;
        
GameTextForPlayer(playerid"~h~24/7"50001);
    }
    else { 
GameTextForPlayer(playerid"~r~Criminals can't hide in here!"50001); }
    return 
1;

Reply
#4

Thanks man.

How can i add here
Код:
if(strcmp(cmd, "/enter", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				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)
					{
					if(GetPlayerWantedLevel(playerid) < 1)
					    {
							SetPlayerInterior(playerid,HouseInfo[i][hInt]);
							SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
							GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
							PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
							PlayerInfo[playerid][pLocal] = i;
                        }
                        else
						{
							GameTextForPlayer(playerid, "~r~Criminals can't hide in houses!", 5000, 1);
							return 1;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
						return 1;
					}
				}
			}
			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 || GetPlayerCash(playerid) >= BizzInfo[i][bEntranceCost])
					{
					if(GetPlayerWantedLevel(playerid) < 1)
					    {
						if(PlayerInfo[playerid][pPbiskey] != i)
						{
							if(BizzInfo[i][bLocked] == 1)
							{
								GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
								return 1;
							}
							if(BizzInfo[i][bProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
							GivePlayerCash(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, 1);
					}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Criminals can't hide in houses!", 5000, 1);
						return 1;
					}
				}
			}
if(GetPlayerWantedLevel(playerid) <= 1) ? I tried but don't work ..
Reply
#5

You just need to put this after all this code:

PHP код:
if(GetPlayerWantedLevel(playerid) < && IsPlayerInRangeOfPoint(playerid5.0,999.2678,-919.9958,42.1797))
{
    
SetPlayerPos(playerid,-27.312299,-29.277599,1003.557250);
    
SetPlayerInterior(playerid,4);
    
PlayerInfo[playerid][pInt] = 4;
    
GameTextForPlayer(playerid"~h~24/7"50001);
}
else { 
GameTextForPlayer(playerid"~r~Criminals can't hide in here!"50001); } 
Reply
#6

Quote:
Originally Posted by Shadoww5
Посмотреть сообщение
PHP код:
if(strcmp(cmdtext"/enter"true) == 0)
{
    if(
GetPlayerWantedLevel(playerid) < && IsPlayerInRangeOfPoint(playerid5.0,999.2678,-919.9958,42.1797))
    {
        
SetPlayerPos(playerid,-27.312299,-29.277599,1003.557250);
        
SetPlayerInterior(playerid,4);
        
PlayerInfo[playerid][pInt] = 4;
        
GameTextForPlayer(playerid"~h~24/7"50001);
    }
    else { 
GameTextForPlayer(playerid"~r~Criminals can't hide in here!"50001); }
    return 
1;

Yes, but i don't want this command,i change my mind. I want for houses and business. Thats why i put this code here
Код:
if(strcmp(cmd, "/enter", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				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)
					{
					if(GetPlayerWantedLevel(playerid) < 1)
					    {
							SetPlayerInterior(playerid,HouseInfo[i][hInt]);
							SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
							GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
							PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
							PlayerInfo[playerid][pLocal] = i;
                        }
                        else
						{
							GameTextForPlayer(playerid, "~r~Criminals can't hide in houses!", 5000, 1);
							return 1;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
						return 1;
					}
				}
			}
			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 || GetPlayerCash(playerid) >= BizzInfo[i][bEntranceCost])
					{
					if(GetPlayerWantedLevel(playerid) < 1)
					    {
						if(PlayerInfo[playerid][pPbiskey] != i)
						{
							if(BizzInfo[i][bLocked] == 1)
							{
								GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
								return 1;
							}
							if(BizzInfo[i][bProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
							GivePlayerCash(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, 1);
					}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Criminals can't hide in houses!", 5000, 1);
						return 1;
					}
				}
			}
I've tried to make it works but don't work ...
Reply
#7

You don't want a player when he's drunk enter into the house ?
Reply
#8

Quote:
Originally Posted by Shadoww5
Посмотреть сообщение
You don't want a player when he's drunk enter into the house ?
I don't want a player when he have wanted enter into house/business ...
Reply
#9

Sorry, I wanted to say wanted instead of drunk.

Put this before the first PlayerToPoint:

PHP код:
if(GetPlayerWantedLevel(playerid) > 0) return SendClientMessage(playerid0xFF0000FF"You're wanted by police and can't get into into any home."); 
Reply
#10

Not workin`...

Код:
if(strcmp(cmd, "/enter", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
			if(GetPlayerWantedLevel(playerid) > 0) return SendClientMessage(playerid, 0xFF0000FF, "You're wanted by police and can't get into into any home.");
			    {
				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]);
						SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
						GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
						PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
						PlayerInfo[playerid][pLocal] = i;
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
					}
				}
				}
			}
			for(new i = 0; i < sizeof(BizzInfo); i++)
			{
			if(GetPlayerWantedLevel(playerid) > 0) return SendClientMessage(playerid, 0xFF0000FF, "You're wanted by police and can't get into into any home.");
			    {
				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, 1);
								return 1;
							}
							if(BizzInfo[i][bProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								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, 1);
					}
				}
				}
			}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)