[Tutorial] How to fix onplayerclickmap function
#1

This is how to fix the problem when the position is so far from player and the z coordinate is 0,without using any plugins.
Код:
new bool:ClickedOnMap[MAX_PLAYERS] = false;
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    SetPlayerPos(playerid, fX, fY, 550);
    GameTextForPlayer(playerid,"Teleporting",1000,4);
    ClickedOnMap[playerid] = true;

    return 1;
}
public OnPlayerUpdate(playerid)
{
	if(ClickedOnMap[playerid] == true)
	{
		new Float:p[3];
		GetPlayerPos(playerid,p[0],p[1],p[2]);
		SetPlayerPosFindZ(playerid,p[0],p[1],p[2]);
		KillTimer(TelTimer[playerid]);
		TogglePlayerControllable(playerid, true);
		ClickedOnMap[playerid] = false;
	}
	return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    ClickedOnMap[playerid] = false;
}
I hope its usefull
Reply


Messages In This Thread
How to fix onplayerclickmap function - by leo9 - 13.11.2015, 16:49
Re: How to fix onplayerclickmap function - by Kevln - 13.11.2015, 22:56
Re: How to fix onplayerclickmap function - by Gammix - 14.11.2015, 02:59
Re: How to fix onplayerclickmap function - by Kar - 14.11.2015, 03:03
Re: How to fix onplayerclickmap function - by kristo - 14.11.2015, 10:02
Re: How to fix onplayerclickmap function - by Gammix - 14.11.2015, 11:47
Re: How to fix onplayerclickmap function - by leo9 - 14.11.2015, 14:13

Forum Jump:


Users browsing this thread: 1 Guest(s)