SA-MP Forums Archive
OnPlayerClickMap - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerClickMap (/showthread.php?tid=553519)



OnPlayerClickMap - Rog - 30.12.2014

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;
}



Re: OnPlayerClickMap - dominik523 - 30.12.2014

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


Re: OnPlayerClickMap - Clad - 30.12.2014

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.


Re: OnPlayerClickMap - Stanford - 30.12.2014

Please post the function of "CheckTeleport"


Re: OnPlayerClickMap - iLuXing - 30.12.2014

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.


Re: OnPlayerClickMap - iLuXing - 30.12.2014

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;




Re: OnPlayerClickMap - Rog - 30.12.2014

ty fixed