[Help] Saving + Loading Admin Names
#1

Recently I made this command:

Код:
CMD:setadminname(playerid, params[])
{
    new file[128], pname[MAX_PLAYER_NAME];
    new id, reason[128];
    new name[MAX_PLAYER_NAME+1];
    
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "USERFILES/%s.ini", pname);
    
    if(sscanf(params, "us", id, reason))SendClientMessage(playerid, COLOR_GREY, "USAGE: /setadminname [playerid] [name]");
    else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_NEWBIE,"Player is not connected!");
    else
	{
        new Name[MAX_PLAYER_NAME], KickMessage[128];
        GetPlayerName(playerid, Name, sizeof(Name));
        format(KickMessage, sizeof(KickMessage), "AdmCmd: %s has changed your admin name to %s", Name, reason);
        SendClientMessage(playerid, COLOR_LIGHTRED, KickMessage);
        SetPlayerName(playerid, reason);
        dini_IntSet(file, "AdminName", GetPlayerName(playerid, name, sizeof(name)));
        }
	return 1;
}
Along with this one to go on admin duty:

Код:
CMD:adminduty(playerid, params[])
{
    new file[128], pname[MAX_PLAYER_NAME];
    new adminname;
    
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "USERFILES/%s.ini", pname);

    if(dini_Exists(file))
    {
    adminname = dini_Int(file, "AdminName");
    SetPlayerName(playerid, adminname);
    }
    return 1;
}
But I get these errors:

Код:
C:\Users\TWLeg_000\Desktop\SAMP SERVER\gamemodes\BHRP1.pwn(1098) : error 035: argument type mismatch (argument 2)
C:\Users\TWLeg_000\Desktop\SAMP SERVER\gamemodes\BHRP1.pwn(1097) : warning 204: symbol is assigned a value that is never used: "adminname"
1098 =
Код:
SetPlayerName(playerid, adminname);
1097 =
Код:
adminname = dini_Int(file, "AdminName");
Could someone explain to me how I can fix these errors?
Reply


Messages In This Thread
[Help] Saving + Loading Admin Names - by BornHuman - 17.11.2013, 18:26
Re: [Help] Saving + Loading Admin Names - by HardRock - 17.11.2013, 19:12
Re: [Help] Saving + Loading Admin Names - by BornHuman - 17.11.2013, 19:14
Re: [Help] Saving + Loading Admin Names - by HardRock - 17.11.2013, 19:33
Re: [Help] Saving + Loading Admin Names - by BornHuman - 17.11.2013, 19:54

Forum Jump:


Users browsing this thread: 3 Guest(s)