GetGuestPlayers: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "==Syntax== <syntaxhighlight lang="lua">table getGuestPlayers ( )</syntaxhighlight> ===Returns=== Returns All Players not Login or All Players Guest Account , And vice false")
 
Line 4: Line 4:
===Returns===
===Returns===
Returns All Players not Login or All Players Guest Account , And vice false
Returns All Players not Login or All Players Guest Account , And vice false
==Code==
<section name="Server" class="server" show="true"><syntaxhighlight lang="lua">
function getGuestPlayers (  )
    local Guest = { } ;
    for _ , players_ in ipairs ( getElementsByType ( "player" ) ) do
    local playerAcc = getPlayerAccount ( players_ )
    if isGuestAccount ( playerAcc ) then
    table.insert ( Guest , players_ )
                end
            end
        return Guest
    end
</syntaxhighlight></section>

Revision as of 02:28, 20 August 2016

Syntax

table getGuestPlayers (  )

Returns

Returns All Players not Login or All Players Guest Account , And vice false

Code

Click to collapse [-]
Server
function getGuestPlayers (  )
 
    local Guest = { } ;
 
    for _ , players_ in ipairs ( getElementsByType ( "player" ) ) do
 
    local playerAcc = getPlayerAccount ( players_ )
 
    if isGuestAccount ( playerAcc ) then
 
    table.insert ( Guest , players_ )
 
                end
            end 
        return Guest
    end