AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Wrong section (https://forums.alliedmods.net/showthread.php?t=133498)

Vechta 07-26-2010 04:39

Wrong section
 
Wrong section :S

nikhilgupta345 07-26-2010 07:10

Re: How to create
 
First make a function

public client_putinserver(id) // will run whenever someone connEcts

New name[32]
new file=fopen("addons/amxmodx/configs", "wt") // wt is write text
name=get_user_name(id)
Fprintf(fp, name)

Vechta 07-26-2010 07:47

Re: How to create
 
O.o

How to create an ini file someone can give me an full code ?

nikhilgupta345 07-27-2010 00:38

Re: Wrong section
 
Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
register_plugin("NAME", "1.0", "AUTHOR")
}
public client_putinserver(id)
{
new name[32]
get_user_name(id, name, 31)
write_file("addons/amxmodx/configs/names.txt", name)
}


RedRobster 07-27-2010 01:12

Re: Wrong section
 
I don't know if you meant it or not, but you are better off not hardcoding paths like that.

nikhilgupta345 07-27-2010 01:23

Re: Wrong section
 
Oh, well how should you save the file paths? I knew that, but forgot how to save the paths. :/

RedRobster 07-27-2010 01:35

Re: Wrong section
 
PHP Code:

new gFileName[128]

public 
plugin_init()
{
    new 
dir[64]
    
get_localinfo("amxx_datadir"dir63)
    
format(gFileName127"%s/blah.w/e"dir)


You can replace "amxx_datadir" (data folder) with "amxx_configsdir" (configs folder) if you want. I'm not sure about the rest of them though.


All times are GMT -4. The time now is 00:11.

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