Problem with safeobject.
#1

I just got problem when i entering building its normal like "Loading..." and wait for 3 seconds but theres was stupid things i've seen which when we entering car there were loading as load building too.. here is my entering...

pawn Код:
if(newkeys & 16 && !IsPlayerInAnyVehicle(playerid))
    {
        if(PlayerTemp[playerid][key_enter] == 2)
        {
            CheckExit(playerid);
            CheckEnter(playerid);
            TogglePlayerControllable(playerid, 0);
            GameTextForPlayer(playerid, "Loading..", 4000, 5);
            SetPVarInt(playerid, "LoadingObjects", 1);
            SetTimerEx("SafeLoadObjects", 5000, 0, "d", playerid);
        }
Reply
#2

Why do you have IsPlayerInAnyVehicle under this function? why are you checking if a player is not in a vehicle?

If this is just for a door then only place the door variable, you do not need to add something that doesn't need to be there.

Код:
if(newkeys & 16)
Reply
#3

It was default.
Reply
#4

Update, theres a problem.. when i pressing "F" at anywhere... its keep saying "Loading.." and freezing for 3 seconds like entering a building..
Reply
#5

make a check when players press F like
pawn Код:
if(newkeys & 16 && !IsPlayerInAnyVehicle(playerid))
    {
        if(PlayerTemp[playerid][key_enter] == 2)
        {
            CheckExit(playerid);
            CheckEnter(playerid);
            if(IsPlayerNearAnyDoors(playerid))
            {
                // Enter bulding
                TogglePlayerControllable(playerid, 0);
                GameTextForPlayer(playerid, "Loading..", 4000, 5);
                SetPVarInt(playerid, "LoadingObjects", 1);
                SetTimerEx("SafeLoadObjects", 5000, 0, "d", playerid);
            }
            else
            {
                // Enter vehicle or whatever
            }
        }
Reply
#6

this is about "key_enter" theres no door..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)