/changename Cmd - 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)
+--- Thread: /changename Cmd (
/showthread.php?tid=382691)
/changename Cmd -
Blackazur - 04.10.2012
How can i make that Player can change his Name with /changename or /changenick?
AW: /changename Cmd -
Blackazur - 04.10.2012
Yes, with DINI in "scriptfiles" in a .txt
Re: /changename Cmd -
West X - 04.10.2012
<The content in this post has been removed.>
AW: /changename Cmd -
Blackazur - 04.10.2012
error 017: undefined symbol "pName"
error 017: undefined symbol "frename"
@West X Then i have this 2 Errors.
Re: /changename Cmd -
.v - 04.10.2012
Hi
pawn Код:
stock frename(oldname[], newname[])
{
if(!fexist(oldname)) return false;
new string[128], File:old, File:neww;
old = fopen(oldname, io_read);
neww = fopen(newname, io_write);
while(fread(old, string))
{
StripNewLine(string);
format(string, sizeof(string), "%s\r\n", string);
fwrite(neww, string);
}
fclose(old);
fclose(neww);
fremove(oldname);
return true;
}
pawn Код:
stock pName(playerid)
{
new paname[MAX_PLAYER_NAME];
GetPlayerName(playerid, paname, sizeof(paname));
return paname;
}
AW: /changename Cmd -
Blackazur - 04.10.2012
yes thx, but i save it not in files i save it with dini in "scriptfiles" in a .txt file.
Re: /changename Cmd -
West X - 04.10.2012
Updated my post above with the source code.
AW: /changename Cmd -
Blackazur - 04.10.2012
error 017: undefined symbol "pName"
error 017: undefined symbol "frename"
Then i have too this 2 errors.
Re: /changename Cmd -
West X - 04.10.2012
You will need to include the two stock functions re-posted by '.v' above.
AW: /changename Cmd -
Blackazur - 04.10.2012
Ops, okay thx then i have only this 1 Error:
error 017: undefined symbol "StripNewLine"