Raised This Month: $ Target: $400
 0% 

Write, Update, Remove from a txt file in Plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
mlhcnshn
Junior Member
Join Date: Sep 2011
Old 07-03-2014 , 18:18   Write, Update, Remove from a txt file in Plugin
#1

Hi, i have a question. I found this;

Quote:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
register_plugin("plugin name", "1.00", "plugin author")
register_clcmd("amx_adduser", "newuseradd")
}

public newuseradd(id) {
if ( ! is_user_admin(id) ) {
client_print(id, print_console, "You are not an administrator. Please refrain from using this command!")
return PLUGIN_HANDLED
}

new whattowrite[64], player[32], pass[28]

read_argv(1, player, 31)
read_argv(2, pass, 27)

new target = cmd_target(id, player, 9)
get_user_name(target, player, 31)

format(whattowrite, 63, "^"%s^" ^"%s^"", player, pass)
write_file("addons/amxmodx/nicks.txt", whattowrite)

client_print(id, print_console, "User %s, password %s wrote to file.", player, pass)

return PLUGIN_HANDLED
}
Okay, this is for write in file. But i want to Update and delete them.

Like that;

amx_list

it shows me users and passwords on my console. in of the file.

amx_delete nick

it finds the user in file and deletes it.

amx_update nick newnick

it finds the user in file and updates it.

Sorry for my bad english I hope you understand. Thank you...

Last edited by mlhcnshn; 07-03-2014 at 18:19.
mlhcnshn is offline
 



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 21:16.


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