SA-MP Forums Archive
[HELP] /enter - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] /enter (/showthread.php?tid=220506)



[HELP] /enter - ifly4life - 03.02.2011

ok i have two /enter(s) and when i do them only one will work

Код:
	if(strcmp(cmd, "/enter", true) == 0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3.0, 04.2746,-141.6924,1004.0625))//pd
	    {
		 	SetPlayerPos(playerid, 246.40, 110.84, 1003.22);
		 	SetPlayerInterior(playerid, 10);
		 }
		 else if(IsPlayerInRangeOfPoint(playerid, 3, 2257.4727, -71.0280, 31.6016))
		 {
		    SetPlayerPos(playerid, 302.292877, -143.139099, 1004.062500);
		    SetPlayerInterior(playerid, 7);
		 }
	}
	return 1;
Any idea?


Re: [HELP] /enter - SkizzoTrick - 03.02.2011

Delete the "else if" and put only "if"
Quote:

c) Help yourself
-Read the wiki




Re: [HELP] /enter - ifly4life - 03.02.2011

It still doesnt work =/


Re: [HELP] /enter - SkizzoTrick - 03.02.2011

pawn Код:
if(strcmp(cmd, "/enter", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 04.2746,-141.6924,1004.0625))//pd
        {
            SetPlayerPos(playerid, 246.40, 110.84, 1003.22);
            SetPlayerInterior(playerid, 10);
         }
         else if(IsPlayerInRangeOfPoint(playerid, 3, 2257.4727, -71.0280, 31.6016))
         {
            SetPlayerPos(playerid, 302.292877, -143.139099, 1004.062500);
            SetPlayerInterior(playerid, 7);
         }
    return 1;
    }



Re: [HELP] /enter - ifly4life - 03.02.2011

It still glitches and only can get into one


Re: [HELP] /enter - [L3th4l] - 03.02.2011

Try the code i posted earlier:
pawn Код:
enum BINFO
{
    BInt,
    Float:BPosX,
    Float:BPosY,
    Float:BPosZ,
    Float:BIntX,
    Float:BIntY,
    Float:BIntZ,
};
new Buildings[][BINFO] = {
    // Interior, Entrancex, Entrancey, Entrancez, Interiorx, Interiory, Interiorz
    {10, 4.2746,-141.6924,1004.0625, 246.40, 110.84, 1003.22}, // pd
    {7, 2257.4727, -71.0280, 31.6016, 302.292877, -143.139099, 1004.062500}
    };

CMD:enter(playerid, params[])
{
    for(new i = 0; i < sizeof(Buildings); ++i)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10, Buildings[i][BPosX], Buildings[i][BPosY], Buildings[i][BPosZ]))
        {
            SetPlayerPos(playerid, Buildings[i][BIntX], Buildings[i][BIntY], Buildings[i][BIntZ]);
            SetPlayerInterior(playerid, Buildings[i][BInt]);
        }
    }
    return 1;
}



Re: [HELP] /enter - ifly4life - 03.02.2011

nvm guys fixed thanks for the help