[Include] [INC] Map teleport fix. - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (
https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] Map teleport fix. (
/showthread.php?tid=107732)
[INC] Map teleport fix. -
Christopher. - 10.11.2009
How dose this work?
This INC works by toggling the players controllable for 2 seconds then releasing it ensuring that the map has enough time to load, So no more dropping though the map when a player teleports somewhere.
How do i use this?
Copy the "ChrisMapFix.inc" into your Pawno/Includes folder.
At the top of your Gamemode/Filterscript put:
Code:
#include <ChrisMapFix>
When you code a teleport you use:
Code:
SetPlayerTimedPos(playerid, X, Y, Z);
Instead of:
Code:
SetPlayerPos(playerid, X, Y, Z);
This INC is fully tested by me, This is my first release so be kind, And ideas welcome!.
Download:
ChrisMapFix.inc
Re: [INC] Map teleport fix. -
aspire5630 - 10.11.2009
Or people can just use this...
Code:
// Anywhere in your script
stock FreezePlayer(playerid, milliseconds)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~r~Loading...", 2000, 6);
SetTimerEx("UnfreezePlayer", milliseconds, 0, "i", playerid);
}
forward UnfreezePlayer(playerid);
public UnfreezePlayer(playerid)
{
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~g~Loaded!", 2000, 6);
return 1;
}
Then use this on your teleports
Code:
FreezePlayer(playerid, 2500);
Re: [INC] Map teleport fix. -
Christopher. - 10.11.2009
It's quicker using this.
Re: [INC] Map teleport fix. -
iLinx - 10.11.2009
Quote:
Originally Posted by aspire5630
Or people can just use this...
Code:
// Anywhere in your script
stock FreezePlayer(playerid, milliseconds)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~r~Loading...", 2000, 6);
SetTimerEx("UnfreezePlayer", milliseconds, 0, "i", playerid);
}
forward UnfreezePlayer(playerid);
public UnfreezePlayer(playerid)
{
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~g~Loaded!", 2000, 6);
return 1;
}
Then use this on your teleports
Code:
FreezePlayer(playerid, 2500);
|
yeah that's pretty much the best way to do it ;]
Re: [INC] Map teleport fix. -
Infamous - 10.11.2009
Very nice release mate, keep up the good work!
Re: [INC] Map teleport fix. -
Christopher. - 11.11.2009
Quote:
Originally Posted by Infamous
Very nice release mate, keep up the good work!
|
Thanks