OnPlayerClickMap
#1

It's working cool and fine. But everytime I use right click it goes back to red marker. How to I disable that?

Code below:

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

pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
        new Babatz = GetPlayerVehicleSeat(playerid);
    if(!IsPlayerInAnyVehicle)
        {
            SetPlayerPosFindZ(playerid, fX, fY, fZ);
        }
    else
        {
            new Batz = GetPlayerVehicleID(playerid);
            SetVehiclePos(Babatz,fX,fY,fZ);
            PutPlayerInVehicle(playerid,Babatz,Batz);
        }
    return 1;
}
EDIT: There is no actual way to disable to marker automatically, it can only be done manually by the player themself.
Reply
#3

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
        new Babatz = GetPlayerVehicleSeat(playerid);
    if(!IsPlayerInAnyVehicle)  <------- Error on this line
        {
            SetPlayerPosFindZ(playerid, fX, fY, fZ);
        }
    else
        {
            new Batz = GetPlayerVehicleID(playerid);
            SetVehiclePos(Babatz,fX,fY,fZ);
            PutPlayerInVehicle(playerid,Babatz,Batz);
        }
    return 1;
}
EDIT: There is no actual way to disable to marker automatically, it can only be done manually by the player themself.
Ohh i see. And for the error:

Код:
(9350) : warning 217: loose indentation
(9350) : error 076: syntax error in the expression, or invalid function call
Reply
#4

lol sorry, I'm doing this on an iphone.
pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    new Babatz = GetPlayerVehicleSeat(playerid);
    if(!IsPlayerInAnyVehicle(playerid))
    {
        SetPlayerPosFindZ(playerid, fX, fY, fZ);
    }
    else
    {
        new Batz = GetPlayerVehicleID(playerid);
        SetVehiclePos(Babatz,fX,fY,fZ);
        PutPlayerInVehicle(playerid,Babatz,Batz);
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
lol sorry, I'm doing this on an iphone.
pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    new Babatz = GetPlayerVehicleSeat(playerid);
    if(!IsPlayerInAnyVehicle(playerid))
    {
        SetPlayerPosFindZ(playerid, fX, fY, fZ);
    }
    else
    {
        new Batz = GetPlayerVehicleID(playerid);
        SetVehiclePos(Babatz,fX,fY,fZ);
        PutPlayerInVehicle(playerid,Babatz,Batz);
    }
    return 1;
}
Works like a charm! thanks man you always help me. Anyway Ill put you in my credits.
Reply
#6

Quote:
Originally Posted by kbalor
Посмотреть сообщение
Works like a charm! thanks man you always help me. Anyway Ill put you in my credits.
Didn't notice that. When im in vehicle its not working.. but when im on foot it teleports.
Reply
#7

pawn Код:
if(!IsPlayerInAnyVehicle(playerid))
{
 SetPlayerPosFindZ(playerid, fX, fY, fZ);
}
Because your only executing the code if the player isn't in a vehicle..
Reply
#8

pawn Код:
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;
}
Sorry once again xD
Reply
#9

Quote:
Originally Posted by Steven82
Посмотреть сообщение
pawn Код:
if(!IsPlayerInAnyVehicle(playerid))
{
 SetPlayerPosFindZ(playerid, fX, fY, fZ);
}
Because your only executing the code if the player isn't in a vehicle..
what should I do now? Can you give me the whole script? thanks!
Reply
#10

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
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;
}
Lol you killed it once again! thanks mate.
Sorry once again xD
Also VirtualWorld thing fixed another thanks! +rep

Can i ask something??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)