SA-MP Forums Archive
/enter and /exit - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /enter and /exit (/showthread.php?tid=425064)



/enter and /exit - ZizPower7610 - 24.03.2013

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");
}



Re: /enter and /exit - Scrillex - 24.03.2013

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);
        }



Re: /enter and /exit - ZizPower7610 - 24.03.2013

Thank`s Thank`s Man Worked Rep +


Re: /enter and /exit - Denying - 24.03.2013

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.


Re: /enter and /exit - BigGroter - 24.03.2013

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?