[Include] [INC] Map teleport fix.
#1

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
Reply
#2

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);
Reply
#3

It's quicker using this.
Reply
#4

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 ;]
Reply
#5

Very nice release mate, keep up the good work!
Reply
#6

Quote:
Originally Posted by Infamous
Very nice release mate, keep up the good work!
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)