OnPlayerClickMap
#1

i m using a system in which when admin is on-duty and h clicks on map anywhere he wants and he get teleported there but when i added those codes it isnt working can u plz fix it for me?
Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	SetTimerEx("CheckTeleport", 5000,false,"iffffff", playerid, x,y,z,fX,fY,fZ);
	if(PlayerInfo[playerid][Level] >= 1)
	{
	    if(PlayerInfo[playerid][OnDuty] == 1)
	    {
		    SetPlayerPosFindZ(playerid, fX, fY, fZ);
		}
	}
    return 1;
}
Reply
#2

What doesn't work? That code or player falls through the map?
Reply
#3

pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
        if(PlayerInfo[playerid][OnDuty] == 1)
        {
            SetPlayerPosFindZ(playerid, fX, fY, fZ);
    }
    return 1;
}
No need to use if player level 1, Since the player itself can't be on duty without being Admin level 1.
Reply
#4

Please post the function of "CheckTeleport"
Reply
#5

maybe you should use SetPlayerPos first,
if it run, your code has another matter,
if not, check the SetPlayerPosFindZ wiki.


OR

just print the value of your variable.

OR

add a print if it run.
Reply
#6

PHP код:
public OnPlayerClickMap(playeridFloat:fXFloat:fYFloat:fZ) {
    print(
"0");
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    print(
"1");
    
SetTimerEx("CheckTeleport"5000,false,"iffffff"playeridx,y,z,fX,fY,fZ);
    print(
"2");
    if(
PlayerInfo[playerid][Level] >= 1)
    {
        print(
"3");
        if(
PlayerInfo[playerid][OnDuty] == 1)
        {
            print(
"4");
            
SetPlayerPosFindZ(playeridfXfYfZ);
            print(
"5");
        }
    }
    print(
"6");
    return 
1;

Reply
#7

ty fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)