Help please
#1

Hey guys. I started scripting again but I've forgot a few things because it was a little while ago.

I want to know how to check if 3 players are here:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1967.6681,-1155.7656,20.9705))
And when one of them uses /start in that range of point and the 3 of them are standing there.
The 3 of them must get a sendclientmessage.

How to do this?
Please help.
Reply
#2

pawn Код:
for(new i = 0; i < 3; i++) // 3 is ammount of players
{
    if(!IsPlayerInRangeOfPoint(i, 7.0, 1967.6681,-1155.7656,20.9705))
    {
        return SendClientMessageToAll(0xFFFFFF,"ERROR: There are not 3 players in the checkpoint.");
    }
    else return 1;
}
This is the basic idea, if you mean it.
Reply
#3

Quote:
Originally Posted by bartje01
Посмотреть сообщение
Hey guys. I started scripting again but I've forgot a few things because it was a little while ago.

I want to know how to check if 3 players are here:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1967.6681,-1155.7656,20.9705))
And when one of them uses /start in that range of point and the 3 of them are standing there.
The 3 of them must get a sendclientmessage.

How to do this?
Please help.
Have you tried using a foreach? Anyways, is the players somehow related; like they have to be in the same faction or at the same lvl?
Reply
#4

It doesn't minds. It's fine when there are just 3 people standing at the position.

Admantis. I directly remembered this code.

And now just SendClientMessage(i,color_red,"it started"); ?
Reply
#5

Quote:
Originally Posted by bartje01
Посмотреть сообщение
It doesn't minds. It's fine when there are just 3 people standing at the position.

Admantis. I directly remembered this code.

And now just SendClientMessage(i,color_red,"it started"); ?
I dont understand a shit, what you want to mean?
Reply
#6

Quote:
Originally Posted by admantis
Посмотреть сообщение
I dont understand a shit, what you want to mean?
I'm not sure, but I guess he wants something like this:
pawn Код:
for(new i = 0; i < 3; i++) // 3 is ammount of players
{
    if(!IsPlayerInRangeOfPoint(i, 7.0, 1967.6681,-1155.7656,20.9705))
    {
        return SendClientMessageToAll(0xFFFFFF,"ERROR: There are not 3 players in the checkpoint.");
    }
    else
    {
    SendClientMessage(i,color_red,"it started");
    }
}
Reply
#7

Quote:
Originally Posted by _rAped
Посмотреть сообщение
I'm not sure, but I guess he wants something like this:
pawn Код:
for(new i = 0; i < 3; i++) // 3 is ammount of players
{
    if(!IsPlayerInRangeOfPoint(i, 7.0, 1967.6681,-1155.7656,20.9705))
    {
        return SendClientMessageToAll(0xFFFFFF,"ERROR: There are not 3 players in the checkpoint.");
    }
    else
    {
    SendClientMessage(i,color_red,"it started");
    }
}
It's okay, besides that he should add his own functions too. But the 'it started' text will show ONLY to the players that are in the checkpoint, not to everyone.
Reply
#8

Quote:
Originally Posted by admantis
Посмотреть сообщение
It's okay, besides that he should add his own functions too. But the 'it started' text will show ONLY to the players that are in the checkpoint, not to everyone.
Yeah, isn't that the purpose? He could just change to SendClientMessage() to SendClientMessageToAll() in case that's what he wants.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)