SA-MP Forums Archive
HElp please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HElp please (/showthread.php?tid=171701)



HElp please - bartje01 - 27.08.2010

Hey guys. I want that my fname switches to the player's name when he types /fname
I have this:

enum faction
{
fname[50]

};

pawn Код:
dcmd_fname(playerid,params[])
{
#pragma unused params


new pname[24];
new str1[256];
GetPlayerName(playerid, pname, 24);
format(str1, sizeof(str1), "factions/faction1/%s", udb_encode(pname));
dini_Set(str1, "fname",pname);

return 1;
}
But when I use the command and I look in the faction1 file. The name isn't changed

I never worked with things like this. I really want to know this.




Thanks in advance


Re: HElp please - Jeffry - 27.08.2010

Well, you need the "faction1" folder. And in this "faction1" folder you need the Player's user file.

Create the Folder, and put the file: Hoi.txt (Your name).

and the line make to:
pawn Код:
format(str1, sizeof(str1), "factions/faction1/%s.txt", udb_encode(pname));
Try it out.


Re: HElp please - bartje01 - 27.08.2010

Couuld you please help me on teamviewer? I really can't come out


Re: HElp please - Jeffry - 27.08.2010

I got no time anymore.

Have xFire? Add me there (mmjeffrymm). I'm back online tomorrow evening.