Local ooc command
#1

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
Reply
#2

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()
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)