AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Write, Update, Remove from a txt file in Plugin (https://forums.alliedmods.net/showthread.php?t=243383)

mlhcnshn 07-03-2014 18:18

Write, Update, Remove from a txt file in Plugin
 
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...

Eagle07 07-03-2014 19:00

Re: Write, Update, Remove from a txt file in Plugin
 
try this best
Register System V9.0 by m0skVi4a ;]

hornet 07-03-2014 20:13

Re: Write, Update, Remove from a txt file in Plugin
 
Simple, save by Steam ID instead.

mlhcnshn 07-03-2014 20:46

Re: Write, Update, Remove from a txt file in Plugin
 
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.

wickedd 07-03-2014 22:33

Re: Write, Update, Remove from a txt file in Plugin
 
Quote:

Originally Posted by mlhcnshn (Post 2161604)
I can't use steam id.

Why not?

mlhcnshn 07-04-2014 07:35

Re: Write, Update, Remove from a txt file in Plugin
 
Because, my server is non-steam. It is not* working.

wickedd 07-04-2014 07:58

Re: Write, Update, Remove from a txt file in Plugin
 
Quote:

Originally Posted by mlhcnshn (Post 2161778)
Because, my server is non-steam. It is not* working.

Final word about No-Steam!

hornet 07-04-2014 09:04

Re: Write, Update, Remove from a txt file in Plugin
 
Non Steam is not supported here.


All times are GMT -4. The time now is 21:16.

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