Check if GTA:SAMP is Running with Administrative Priviledges

Code:
:IsSAMPRunnedAsAdministrator
    if 0AA2: 31@ = load_dynamic_library "Shell32.dll"
    then
        if 0AA4: 30@ = get_dynamic_library_procedure "IsUserAnAdmin" library 31@
        then 0AA7: call_function_return 30@ num_params 0 pop 0 _StoreBooleanTo 29@
        end
        0AA3: free_dynamic_library 31@
    end
    if 29@ == true
    then 0485:  return_true
    else 059A:  return_false
    end
0AB2: cleo_return 0

Demonstration:
Code:
{$CLEO}
0000:

while true
    wait 0
    if 0AB1: @IsSAMPRunnedAsAdministrator 0
    then 0ACD: show_text_highpriority "GTA SAMP was Runned as Administrator" time 100
    else 0ACD: show_text_highpriority "GTA SAMP has no Administrative Privileges" time 100
    end
end

Notes:
This Snippet only Detects GTA:SAMP Administrator Privileges, so if you're trying to know if the SAMP Client runs as Admin then you can assume with the fact that SAMP Client and GTA:SAMP have the Same Administrative Privileges(As long as you did not Manually Changed the Admin Privileges of GTA:SAMP).
 
Top