dcmd_enter help
#1

Okey, I've got this:

pawn Код:
dcmd_enter(playerid, params[])
{
    #pragma unused params
    for(new f=0; f<=MAX_FACTIONS; f++)
    {
        if(PlayerToPoint(1.0,playerid,FactionInfo[f][fEnterX],FactionInfo[f][fEnterY],FactionInfo[f][fEnterZ]))
        {
            if(FactionInfo[f][fLocked] == 1 && PlayerInfo[playerid][pFaction] != f)
            {
                GameTextForPlayer(playerid,"~r~Locked",3000,1);
                return 1;
            }
            SetPlayerPos(playerid,FactionInfo[f][fInteriorX],FactionInfo[f][fInteriorY],FactionInfo[f][fInteriorZ]);
            SetPlayerInterior(playerid,FactionInfo[f][fInteriorID]);
            SetPlayerVirtualWorld(playerid,FactionInfo[f][fVirtual]);
            return 1;
        }
        else return SendErrorMessage(playerid, ".: Info: Not at an entrance :.");
    }
    return 1;
}
But for some reason... This doesn't work as it should...

It says: Not at an entrance, when i'm at an entrance....

Anyone knows why?
Reply
#2

pawn Код:
dcmd_enter(playerid, params[])
{
    #pragma unused params
    for(new f=0; f<MAX_FACTIONS; f++)
    {
        if(PlayerToPoint(1.0,playerid,FactionInfo[f][fEnterX],FactionInfo[f][fEnterY],FactionInfo[f][fEnterZ]))
        {
            if(FactionInfo[f][fLocked] == 1 && PlayerInfo[playerid][pFaction] != f)
            {
                GameTextForPlayer(playerid,"~r~Locked",3000,1);
                return 1;
            }
            SetPlayerPos(playerid,FactionInfo[f][fInteriorX],FactionInfo[f][fInteriorY],FactionInfo[f][fInteriorZ]);
            SetPlayerInterior(playerid,FactionInfo[f][fInteriorID]);
            SetPlayerVirtualWorld(playerid,FactionInfo[f][fVirtual]);
            return 1;
        }
    }
    SendErrorMessage(playerid, ".: Info: Not at an entrance :.");
    return 1;
}
Reply
#3

Thank man It worked (A) You're the man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)