SA-MP Forums Archive
dcmd_enter help - 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: dcmd_enter help (/showthread.php?tid=156855)



dcmd_enter help - introzen - 24.06.2010

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?


Re: dcmd_enter help - MadeMan - 24.06.2010

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



Re: dcmd_enter help - introzen - 24.06.2010

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