OnPlayerClickMap
#1

It always teleports me back to red marker after clicking right click. How to disable it?

Here's the script:

Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    if(!IsPlayerInAnyVehicle(playerid))
    {
        SetPlayerPosFindZ(playerid, fX, fY, fZ);
    }
    else if(IsPlayerInAnyVehicle(playerid))
    {
        new Babatz = GetPlayerVehicleID(playerid);
        new Batz = GetPlayerVehicleSeat(playerid);
        SetVehiclePos(Babatz,fX,fY,fZ);
        PutPlayerInVehicle(playerid,Babatz,Batz);
    }
    return 1;
}
Reply
#2

If this is possible pm or make a reply thanks!
Reply
#3

If you don't want it to teleport you when you place a marker, delete all that code you posted.
Reply
#4

Quote:
Originally Posted by MP2
Посмотреть сообщение
If you don't want it to teleport you when you place a marker, delete all that code you posted.
"All caps" I did not say i don't want to teleport when placing marker.

It says It Teleports me BACK to red marker. Oh my God!
Reply
#5

Not going to help you with that attitude.
Reply
#6

Quote:
Originally Posted by MP2
Посмотреть сообщение
Not going to help you with that attitude.
You're being rude. It's like give and take. Hopefully you're doing good. Thanks!
Reply
#7

pawn Код:
new Float:ClickedMap[MAX_PLAYERS][3];

public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    if(ClickedMap[playerid][0] != fX && ClickedMap[playerid][1] != fY && ClickedMap[playerid][2] != fZ)
    {
        ClickedMap[playerid][0] = fX;
        ClickedMap[playerid][1] = fY;
        ClickedMap[playerid][2] = fZ;
        if(!IsPlayerInAnyVehicle(playerid)) SetPlayerPosFindZ(playerid, fX, fY, fZ);
        else if(IsPlayerInAnyVehicle(playerid))
        {
            new Babatz = GetPlayerVehicleID(playerid);
            new Batz = GetPlayerVehicleSeat(playerid);
            SetVehiclePos(Babatz,fX,fY,fZ);
            PutPlayerInVehicle(playerid,Babatz,Batz);
        }
    }
    return 1;
}
Untested btw XD
Reply
#8

Quote:
Originally Posted by Andi_Evandy
Посмотреть сообщение
pawn Код:
new Float:ClickedMap[MAX_PLAYERS][3];

public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    if(ClickedMap[playerid][0] != fX && ClickedMap[playerid][1] != fY && ClickedMap[playerid][2] != fZ)
    {
        ClickedMap[playerid][0] = fX;
        ClickedMap[playerid][1] = fY;
        ClickedMap[playerid][2] = fZ;
        if(!IsPlayerInAnyVehicle(playerid)) SetPlayerPosFindZ(playerid, fX, fY, fZ);
        else if(IsPlayerInAnyVehicle(playerid))
        {
            new Babatz = GetPlayerVehicleID(playerid);
            new Batz = GetPlayerVehicleSeat(playerid);
            SetVehiclePos(Babatz,fX,fY,fZ);
            PutPlayerInVehicle(playerid,Babatz,Batz);
        }
    }
    return 1;
}
Untested btw XD
Thanks for the reply. But it still teleports me back to red marker after clicking right click.
Reply
#9

Why don't you make it where if ClickedMap[playerid][#] = 0.0, then it does nothing. If you don't know how to do such, then I will do it for you.
Reply
#10

Quote:
Originally Posted by GSRP
Посмотреть сообщение
Why don't you make it where if ClickedMap[playerid][#] = 0.0, then it does nothing. If you don't know how to do such, then I will do it for you.
Yes please?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)