/enter and /exit
#1

I just want the /enter to work for every interior,I currently Have like 10 Interiors and only one is working with /enter but the second interior isn`t working with /enter

Код:
	if(strcmp(cmdtext, "/enter", true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1975.9144,1612.8906,9.86875))
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2017.9628,1103.1355,10.8203))
		{
			SetPlayerPos(playerid, 268.36044311523, -48.938175201416, 375.28506469727);
			SetPlayerInterior(playerid, 0);
			SetPlayerPos(playerid, 290.85040283203, -73.214797973633, 1006.8);
			SetPlayerInterior(playerid, 1);
		}
		else
		{
		    SendClientMessage(playerid, 0xFA0505FF, "You are not near the enterance.");
		}
		return 1;
	}
	if(strcmp(cmdtext, "/exit", true, 10) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 265.4691,-49.8297,374.7559))
	    {
			SetPlayerPos(playerid, 1978.0145, 1616.1121, 10.0781);
			SetPlayerInterior(playerid, 0);
		}
		else
		{
		    SendClientMessage(playerid, 0xFA0505FF, "You are not near the exit.");
		}
		return 1;
	}
	return SendClientMessage(playerid, 0xFFFFFFAA, "[ELITE GANGWARS]: This command wasn't found. Please use /ehelp");
}
Reply
#2

Its just example .. so basiclly just showed how it look like! So dont just copy paste it!
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2017.9628,1103.1355,10.8203))
        {
            SetPlayerPos(playerid, 268.36044311523, -48.938175201416, 375.28506469727);
            SetPlayerInterior(playerid, 0);
        }
else if(IsPlayerInRangeOfPoint(playerid, 3.0, second coords))
        {
            SetPlayerPos(playerid, 290.85040283203, -73.214797973633, 1006.8);
            SetPlayerInterior(playerid, 1);
        }
Reply
#3

Thank`s Thank`s Man Worked Rep +
Reply
#4

Quote:
Originally Posted by ZizPower7610
Посмотреть сообщение
Thank`s Thank`s Man Worked Rep +
But, try making it dynamic by saving each and every house's entrance coordinates and just looping around them all checking if he's at one of them.

It would save you time and a whole lot of lines.
Reply
#5

Quote:
Originally Posted by Denying
Посмотреть сообщение
But, try making it dynamic by saving each and every house's entrance coordinates and just looping around them all checking if he's at one of them.

It would save you time and a whole lot of lines.
How would this be done?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)