Problem with safeobject. - 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)
+--- Thread: Problem with safeobject. (
/showthread.php?tid=516658)
Problem with safeobject. -
ajam112 - 01.06.2014
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);
}
Re: Problem with safeobject. -
Ciandlah - 01.06.2014
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.
Re: Problem with safeobject. -
ajam112 - 01.06.2014
It was default.
Re: Problem with safeobject. -
ajam112 - 01.06.2014
Update, theres a problem.. when i pressing "F" at anywhere... its keep saying "Loading.." and freezing for 3 seconds like entering a building..
Re: Problem with safeobject. -
rickisme - 01.06.2014
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
}
}
Re: Problem with safeobject. -
ajam112 - 01.06.2014
this is about "key_enter" theres no door..