Command with ID
#2

How about this instead:

pawn Код:
YCMD:changename(playerid, params[], help){
    if(pInfo[playerid][pLogged] == 1 && pInfo[playerid][pAdminLevel] >= 5){
    new name[MAX_PLAYER_NAME];
    new PlayerID;
    if(sscanf(params, "is[MAX_PLAYER_NAME]", name, PlayerID)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /changename [id] [name]")
    new oldname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, oldname);
    new filestring[128];
    format(filestring, sizeof(filestring), "/Users/%s.ini", oldname);
    new filestring2[128];
    format(filestring, sizeof(filestring), "/Users/%s.ini", name);
    frename(filestring, filestring2);
    SetPlayerName(PlayerID, name);
    }
    else{
    SendClientMessage(playerid, 0xFFFFFFFF, "Not logged in or whatever.");
    }
    return 1;
}
Just something I wrote real quick through a quick reply here on SA-MP forums, so there might be errors. However, hopefully you'll get an idea of how to do it.
Reply


Messages In This Thread
Command with ID - by Blackazur - 26.06.2013, 16:45
Re: Command with ID - by Deathstalker - 26.06.2013, 17:04
Re: Command with ID - by Jefff - 26.06.2013, 17:23

Forum Jump:


Users browsing this thread: 1 Guest(s)