Onplayerclickmap not working Help REP+
#1

Hello this is the code i am using for map teleport it was working eariler but dont know why its not working ??

Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
	  if(PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][OnDuty] == 1)
	{
	    if(IsPlayerInAnyVehicle(playerid))
		{
		    new vid;
		    vid = GetPlayerVehicleID(playerid);
		    SetVehiclePos(vid, fX, fY, fZ);
		    SetPlayerPosFindZ(playerid, fX, fY, fZ);
		    PutPlayerInVehicle(playerid, vid, 0);
		}
		else
		{
			SetPlayerPosFindZ(playerid, fX, fY, fZ);
		}
	}
	return 1;
}
Reply
#2

I don't see any code error there, are you sure that pLevel and OnDuty have the right value?

PD: try sending a message to the player to see what happens.
Reply
#3

From: https://sampwiki.blast.hk/wiki/SetPlayerPosFindZ

This function does not work if the new coordinates are far away from where the player currently is. The Z height will be 0, which will likely put them underground. It is highly recommended that the MapAndreas plugin be used instead.

Your pos is probably too far away for the function to handle, and will therefore not work.
Reply
#4

Quote:
Originally Posted by [DOG]irinel1996
Посмотреть сообщение
I don't see any code error there, are you sure that pLevel and OnDuty have the right value?

PD: try sending a message to the player to see what happens.
I check everything didn't work it was working before but now i was testing my gm it was not working :/
Reply
#5

Give a try in a clean gamemode like lvdm.
Reply
#6

SetPlayerPosFindZ does not work if the new coordinates are far away. Try to teleport to somewhere close to your position.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)