Problem
#1

Hey,

I have a problem with my command which is /setname:

pawn Код:
dcmd_setname(playerid,params[])
{
    if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid)) {
        new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
        if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /setname [playerid] [new name]");
        new player1 = strval(tmp), length = strlen(tmp2), string[128];
        if(length < 3 || length > MAX_PLAYER_NAME) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Incorrect Name Length");
        if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You cannot use this command on this admin");
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
            format(string, sizeof(string), "You have set \"%s's\" name to \"%s\" ", pName(player1), tmp2); SendClientMessage(playerid,COLOR_ORANGE,string);
            if(player1 != playerid) { format(string,sizeof(string),"Administrator \"%s\" has set your name to \"%s\" ", pName(playerid), tmp2); SendClientMessage(player1, COLOR_BLUE, string); }
            SetPlayerName(player1, tmp2);
            return OnPlayerConnect(player1);
        } else return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Player is not connected");
    } else return SendClientMessage(playerid, COLOR_RED,"[ERROR]: You are not a high enough level to use this command");
}
When I set a players name, they relog with the new name and the name doesn't exist. Basically like a temporary name change. Can anyone make this a permanent name change by changing the current name of the .ini file created ?

Regards,

Sean aka sniperwars
Reply
#2

Change tha name of archive
Reply
#3

Do I really want to do that ? I don't have time to visit the Volt-Host panel and change of a 100 hundred accounts names. Is there any other way of doing it ?
Reply
#4

What's your file system?
Reply
#5

Each account saves as an .ini file.
Reply
#6

Anyone ?

I really need this command fixed like now :/
Reply
#7

You use Dini, y_ini ,etc ?
Reply
#8

The plugin is dudb.
Reply
#9

use Zcmd better
pawn Код:
CMD:setname(playerid,params[])
{
    if(Info[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
    {
        new id, name[24], str[130], newname;
        if(sscanf(params, "udd", id,name,newname)) return SendClientMessage(playerid,red,"/SetName [Playerid/Name] [New Name]");
        GetPlayerName(id,name,24);
        format(str,130,"You Changed %s (%d)'s Name to $%d",name,id,newname);
        SendClientMessage(playerid,lightblue,str);
        format(str,130, "Admin Changed Your Name to $%d",newname);
        SendClientMessage(playerid,lightblue,str);
        SetPlayerName(id,name);
    } else return SendClientMessage(playerid,red,"You are not Authorized to use this command");
    return 1;
}
Reply
#10

Show the code that saves/loads user info from .ini file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)