Markers
#1

Hello! I don't fully understand markers. I want some commands to work only in marker. If a player isn't in marker it will return a message like: "You're not in front of fast-food market!" And I want it to be written, like text on screen, not on marker reach send client message but right on the screen message in front of the fast food stand like: Fast Food stand - type /fastfood to buy!
And it will display a dialog which I know how to create.
Reply
#2

https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint
Reply
#3

Yeah. How do I know how big my checkpoint is?
And how can I make a command only use-able in a checkpoint?
Reply
#4

Quote:
Originally Posted by Bek_Loking
Посмотреть сообщение
How do I know how big my checkpoint is?
Play around with the size and go in-game to see how small or big the checkpoint is.

Quote:
Originally Posted by Bek_Loking
Посмотреть сообщение
And how can I make a command only use-able in a checkpoint?
https://sampwiki.blast.hk/wiki/IsPlayerInCheckpoint
Reply
#5

for checking if they're in a CP:

pawn Код:
CMD:something(playerid,params[])
{
    if(IsPlayerInCheckpoint(playerid)) //they are
    {
        //code
    }
    else //they arent
    {
        //code
    }
    return 1;
}
The size of the checkpoint:

pawn Код:
SetPlayerCheckpoint(playerid, x, y, z, size)
The last parameter.

I reccomend using a streamer though. Since

Quote:

Checkpoints are asynchronous, meaning only one can be shown at a time. To 'stream' checkpoints (only show them when players are close enough), use a checkpoint streamer.

Incognitos does this iirc
Reply
#6

First thing first, markers are reprsented by MapIcons, SetPlayerMapIcon search this function and learn it.
Secondly, for the verificaiton part, you need a function that is called IsPlayerInRangeOfPoint, search and learn it.
Thirdly, I will show you an example of using both of them.

Код:
public OnPlayerConnect(playerid)
{ 
   SetPlayerMapIcon(playerid, 0, yourxhere, youryhere, yourzhere, 10, yourcolorhere,  3);
   return 1;
}
Also an example for usage of IsPlayerInRangeOfPoint

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/test", false))
    {
        if(!IsPlayerInRangeOfPoint(playerid, yourmaxradiussizehere, yourxhere, youryhere, yourzhere))
        {
            return SendClientMessage(playerid, yourcolorhere, yourmessagehere)
         }
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)