Show list , help
#1

Hello! How can I solve this?
if you type the command /savename, save the name of a text document..
if you type the command /namelist, list the names who enter the command (/savename)
Problem: Saves the name ,but /namelist command does not add up

Photo:
Save: http://www.kephost.com/image/f4M
Server: http://www.kephost.com/image/f4C

Code:
Код:
#define RFILES "namelist.txt"
CMD:savename(playerid,params[])
{
	new pname[24], File:ftw=fopen("namelist.txt", io_write);

    if(ftw)
    {
        GetPlayerName(playerid, pname, 24);
        fwrite(ftw, pname);
        fclose(ftw);
    }
	return 1;
}
CMD:namelist(playerid,params[])
{
		new str[256];
	    new oldrecord = dini_Int(RFILES,"namelist");
	    format(str,sizeof(str),"[Name-ALL List]: %s ",oldrecord);
	    SCM(playerid,COLOR_SYSTEM,str);
	    return 1;
}
Reply
#2

Try With Dini
Code :
pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, size(pName));
dini_Create(yourfile);
dini_IntSet(yourfile, "Name", pName);
Reply
#3

sorry my bad
delete
pawn Код:
dini_IntSet(yourfile, "Name", pName);
And Relpace :
pawn Код:
dini_Set(yourfile, "Name", pName);
Instead ! .!!!!!!!!!
Reply
#4

?? I do not understand
Reply
#5

pawn Код:
new pName[MAX_PLAYER_NAME]; //player name
GetPlayerName(playerid, pName, sizeof(pName)); // get player name
dini_Create(yourfile); //creates your file
dini_Set(yourfile, "Name", pName); // sets name to the ini file remembering player name
Well hope that helped ! .!
Reply
#6

I do not think so .. name all in one place and the command will list all. save the good! Get the bad
Код:
CMD:namelist(playerid,params[])
{
		new str[256];
	    new oldrecord = dini_Int(RFILES,"namelist");
	    format(str,sizeof(str),"[Name-ALL List]: %s ",oldrecord);
	    SCM(playerid,COLOR_SYSTEM,str);
	    return 1;
}
Reply
#7

Try to add
new NameMAX_PLAYER_NAME];
for(new i; i<MAX_PLAYERS; i++)
{
GetPlayerName(I, Name, sizeof(Name))
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)