Raised This Month: $ Target: $400
 0% 

Write, Update, Remove from a txt file in Plugin


Post New Thread Closed Thread   
 
Thread Tools Display Modes
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
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 07-03-2014 , 19:00   Re: Write, Update, Remove from a txt file in Plugin
#2

try this best
Register System V9.0 by m0skVi4a ;]
__________________
Eagle07 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-03-2014 , 20:13   Re: Write, Update, Remove from a txt file in Plugin
#3

Simple, save by Steam ID instead.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
mlhcnshn
Junior Member
Join Date: Sep 2011
Old 07-03-2014 , 20:46   Re: Write, Update, Remove from a txt file in Plugin
#4

Oh eagle It is very hard. I cant use it.

and

I can't use steam id.

My plugin is this;

A few person can use /bank

They can transfer money and take money.

I want to see them.

Like that : amx_banklist

on my console;

Nick - Money in his bank

Nick - Money in his bank ....


I know. if player is in game than i can see them. But if player isn't in game i want to see them.

Sorry for my bad english.
mlhcnshn is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-03-2014 , 22:33   Re: Write, Update, Remove from a txt file in Plugin
#5

Quote:
Originally Posted by mlhcnshn View Post
I can't use steam id.
Why not?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
mlhcnshn
Junior Member
Join Date: Sep 2011
Old 07-04-2014 , 07:35   Re: Write, Update, Remove from a txt file in Plugin
#6

Because, my server is non-steam. It is not* working.

Last edited by mlhcnshn; 07-04-2014 at 07:51.
mlhcnshn is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-04-2014 , 07:58   Re: Write, Update, Remove from a txt file in Plugin
#7

Quote:
Originally Posted by mlhcnshn View Post
Because, my server is non-steam. It is not* working.
Final word about No-Steam!
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-04-2014 , 09:04   Re: Write, Update, Remove from a txt file in Plugin
#8

Non Steam is not supported here.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Closed Thread



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