Did you use a save system that ties a file to a user name (and if so, why)?
|
No, that's not an answer to my question. That's just a reason for a user system, not a reason for a user system that names files after users.
|
COMMAND:changename(playerid,params[]) { new OtherPlayer12, Msg12[170], Name12[24], Message12[150], OtherPlayerName12[24]; SendAdminText(playerid,"/changename", params); if (APlayerData[playerid][PlayerLevel] < 5) return SendClientMessage(playerid, 0xFFFFFFFF, "[ERROR]: You don't have access!"); else if(sscanf(params, "rs[170]", OtherPlayer12, Message12)) return SendClientMessage(playerid,0xFFFFFFFF, "SYNTAX: /changename <name/id> <newname>"); GetPlayerName(playerid, Name12, sizeof(Name12)); GetPlayerName(OtherPlayer12, OtherPlayerName12, sizeof(OtherPlayerName12)); format(Msg12, sizeof(Msg12), "{FF6600}%s {FFFFFF}has changed {FF6600}%s {FFFFFF}his name to: {FF6600}%s", Name12, OtherPlayerName12, Message12); SendClientMessageToAll(0xFFFFFFFF, Msg12); SetPlayerName(OtherPlayer12, Message12); return 1; }
if(strcmp(cmd, "/changename", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new tmpp[256];
tmpp = strtok(cmdtext, idx);
if(!strlen(tmpp))
{
SendClientMessage(playerid, COLOR_DBLUE, "Correct SYNTAX: /changename [playerid] [new nick]");
return 1;
}
giveplayerid = strval(tmpp);
tmp = strtok(cmdtext, idx);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(giveplayerid))
{
SetPlayerName(giveplayerid, tmp);
format(string, sizeof(string), "AdmCMD: %s(%i) vam je promjenio ime u %s", sendername, playerid, tmp);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "("COL_RED"C.Life{FFFFFF}!) You have changed ID %i's name to %s", giveplayerid, tmp);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, 256, "("COL_RED"C.Life{FFFFFF}!) "COL_RED"%s {FFFFFF}je promjenuo ime "COL_RED"%s{FFFFFF}-a u "COL_RED"%s.", sendername,giveplayer, tmp);
ABroadCast(WHITE,string,1);
}
else
{
format(string, sizeof(string), "%d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Nemate dozovolu za koristenje te komande!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Morate se prijaviti da biste koristili tu komandu!");
}
return 1;
}