SA-MP Forums Archive
Local ooc command - 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 command (/showthread.php?tid=221365)



Local ooc command - davelord - 05.02.2011

Does someone have an idea how i make a local OOC and a OOC command? Ex. When i type /B [text] other people on some distance can see it, and when i do /O [text] everyone sees it. Thanks


Re: Local ooc command - xRyder - 05.02.2011

Yeah. For /b text you should use NearByMessage function
pawn Код:
public NearByMessage( playerid, colour, string[])
{
    new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnectedEx( i ) && IsPlayerSpawned( playerid ) )
        {
            GetPlayerPos( playerid, PlayerX, PlayerY, PlayerZ);
            if(IsPlayerInRangeOfPoint(i, 12, PlayerX, PlayerY, PlayerZ) )
            {
                if(GetPlayerVirtualWorld( playerid ) == GetPlayerVirtualWorld( i ) && GetPlayerInterior( playerid ) == GetPlayerInterior( i ) )
                {
                    SendClientMessage(i, colour, string);
                }
            }
        }
    }
    return true;
}

And for /o simply use SendClientMessageToAll()