Countdown 300m within, outside - 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)
+--- Thread: Countdown 300m within, outside (
/showthread.php?tid=515883)
Countdown 300m within, outside -
Acerbis - 28.05.2014
Hello! I would like your help to ask a simple return preparation count command, so the command should be: if someone starts a countdown, only around see 300m within, who is not to see 300m I was outside but who's to 300 m of in addition you can also get the countdown started, I'd appreciate it if someone could create this for me. Sorry for the bad English for knowledge. Thanks in advance ^ ^
Re: Countdown 300m within, outside -
TheSimpleGuy - 28.05.2014
pawn Код:
new Float:x, Float:y, Float:z;
if(IsPlayerInRangeOfPoint(playerid,300,x,y,z)) {
Sry on phone,if error that argument that doesnt shit, just research it on samp wiki
Re: Countdown 300m within, outside -
Threshold - 28.05.2014
Example:
pawn Код:
CMD:countdown(playerid, params[])
{
new str[60], name[MAX_PLAYER_NAME], Float:x, Float:y, Float:z;
GetPlayerName(playerid, name, sizeof(name));
GetPlayerPos(playerid, x, y, z);
format(str, sizeof(str), "%s(%d) has started a countdown.", name, playerid);
for(new i = 0; i < MAX_PLAYERS; i++) //foreach is a better option
{
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInRangeOfPoint(i, 300.0, x, y, z)) continue;
SendClientMessage(i, 0xFFFF00FF, str);
//Player is within 300 units of playerid.
}
return 1;
}