local OOC - 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: local OOC (
/showthread.php?tid=71144)
local OOC -
masterhix - 30.03.2009
Hello, I am creating a RP server and it's going great! But today i noticed that I need local OOC too. The command should be /b i think.. So can you guys tell me how to make it, because i don't understand that part with getdistancebetweenplayers. So please tell me how to make that command. Thanks
Re: local OOC -
LarzI - 30.03.2009
pawn Код:
if(!strcmp(cmdtext, "/b", true))
{
for(new i=0; i<MAX_PLAYERS; i++) //Gettting all players in the variable i
{
if(GetDistanceBetweenPlayers(playerid, i) <= 20) //Correct me if there are more arguments in Getdistance...
{
if(cmdtext[2] == 32 || cmdtext[3] != EOS) //if there is a space and end of string isn't right after the space
{
new str[128];
format(str, 128, "%s: %s", Name(playerid), cmdtext[3]);
SendClientMessage(i, COLOR_WHITE, str); //Send message to all players nearby
}
}
}
return true;
}
pawn Код:
//place this on bottom of script
Name(i)
{
new n[24];
GetPlayerName(i, n, 24);
return n;
}
That should work
Re: local OOC -
masterhix - 30.03.2009
thanks man.You helped alot :P
Re: local OOC -
Nero_3D - 30.03.2009
This code would never come in my script, its total ineffective coded :S
Re: local OOC -
LarzI - 30.03.2009
I know, I just made it quick