Help please - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help please (
/showthread.php?tid=203786)
Help please -
bartje01 - 28.12.2010
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.
Re: Help please -
admantis - 28.12.2010
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.
Re: Help please -
_rAped - 28.12.2010
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?
Re: Help please -
bartje01 - 28.12.2010
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"); ?
Re: Help please -
admantis - 28.12.2010
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?
Re: Help please -
_rAped - 28.12.2010
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");
}
}
Re: Help please -
admantis - 28.12.2010
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.
Re: Help please -
_rAped - 28.12.2010
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.