Markers -
Bek_Loking - 18.06.2014
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.
Re: Markers -
DobbysGamertag - 18.06.2014
https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint
Re: Markers -
Bek_Loking - 18.06.2014
Yeah. How do I know how big my checkpoint is?
And how can I make a command only use-able in a checkpoint?
Re: Markers -
Konstantinos - 18.06.2014
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
Re: Markers -
DobbysGamertag - 18.06.2014
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
Re: Markers -
XStormiest - 18.06.2014
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;
}