[HELP] /enter
#1

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?
Reply
#2

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

c) Help yourself
-Read the wiki

Reply
#3

It still doesnt work =/
Reply
#4

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;
    }
Reply
#5

It still glitches and only can get into one
Reply
#6

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;
}
Reply
#7

nvm guys fixed thanks for the help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)