Raised This Month: $ Target: $400
 0% 

RCON


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OneMoreLevel
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
Old 10-21-2009 , 12:55   Re: RCON
Reply With Quote #1

This is my code right now:

PHP Code:
/* Plugin made by OneMoreLevel */
/* Date Created, Tuesday, October 20th, 2009. */
/* Plugin name, Log player info */

#include <amxmodx>
#include <amxmisc>
#include <geoip>

#define PLUGIN "Log player Info"
#define VERSION "1.1"
#define AUTHOR "OneMoreLevel"
new const userlogs [] = "userlogs.txt"
new const text [] = ""

public plugin_init() {
    
register_plugin("Log Player Info""1.1""OneMoreLevel")
    
    
register_clcmd"say /logs" "check_userlogs");
    
register_clcmd"say /clearlogs" "clear_userlogs");
    
    
register_concmd"amx_userlogs" "check_userlogs")
    
register_concmd"amx_clearlogs" "clear_userlogs")
    
}
public 
client_connect (id) {
    new 
name [2],ip[33],steamid[63],country[46]
    
    if (
is_user_connected(id)) // This is just to make sure.
        
get_user_name(id,name,1// Lets get the user's name
    
get_user_ip(idip32)    // Get his IP
    
get_user_authid(idsteamid62// And his SteamID
    
geoip_country(ipcountry45)
    
client_print(idprint_console"Welcome %s, this server is using AMMXLogs"name// Free advertising :D
    
    
write_fileuserlogsname, -1// Lets write his name to teh userlogz.
    
write_fileuserlogssteamid,-1)
    
write_fileuserlogsip, -1)
    
write_fileuserlogscountry, -1)
    
write_file(userlogs,"End of user info ---------- End of user info")
    
}    


public 
check_userlogs(id) {
    
    if (
is_user_admin(id))
        
show_motd(id"userlogs.txt""User logs (As of new round)"
    else 
        
client_print(id,print_chat,"[AMXXLogs] You have no access to that!")
    
client_print(id,print_console,"[AMXXLogs] You cannot access that.")
    
}

public 
clear_userlogs(id) {
    
    if (
get_user_flagsid ) & ADMIN_RCON)  
        
delete_file userlogs 
    else
        
client_print(id,print_chat"[AMXXLogs] You have no access to delete server files!")
    
client_print(id,print_console"[AMXXLogs] You do not have RCON access to the server files!")
    
write_file userlogstext 
    

Although I have all the flags in users.ini(excluding the user flag), It still says in console that I cannot delete files. Is there anything wrong with what I did with the RCON thing?

EDIT: Also is there a way to read through a file to check if the STEAMID is already in there?
__________________
60/100 60%
[||||||||||||||||||||]
Project: Warfighter mod
Blog:
http://sites.google.com/site/dailymultitasker/
PHP Code:
   if ( i_help_you "Yes" ) == )
    
set_user_karma(onemorelevel,add,+1

Last edited by OneMoreLevel; 10-21-2009 at 13:15.
OneMoreLevel is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-21-2009 , 13:15   Re: RCON
Reply With Quote #2

PHP Code:
    else
        
client_print(id,print_chat"[AMXXLogs] You have no access to delete server files!")
    
client_print(id,print_console"[AMXXLogs] You do not have RCON access to the server files!"
I think you wanted:

PHP Code:
   else
   {
        
client_print(id,print_chat"[AMXXLogs] You have no access to delete server files!")
        
client_print(id,print_console"[AMXXLogs] You do not have RCON access to the server files!")
   } 
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode