/changename help
#1

PHP код:
enum hInfo
{
    
Name[24],
    
Renter[24],
    
Rentable,
    
Rentcost,
    
Cost,
    
Sell,
    
Interior,
    
Virtualworld,
    
Locked,
    
Float:InteriorX,
    
Float:InteriorY,
    
Float:InteriorZ,
    
Float:iconx,
    
Float:icony,
    
Float:iconz,
    
Rentfee
}
new 
HouseInfo[MAX_HOUSES][hInfo], HouseID
PHP код:
CMD:changename(playerid,params[])
{
    if(
PlayerInfo[playerid][Level] >= || IsPlayerAdmin(playerid))
    {
        new 
Index;
        new 
tmp[256];  tmp  strtok(params,Index);
        new 
tmp2[256]; tmp2 strtok(params,Index);
        if(
isnull(tmp) || isnull(tmp2)) return
        
SendClientMessage(playeridLIGHTBLUE2"USAGE: /changename [playerid] [NewName]");
        new 
player1 strval(tmp);
        new 
length strlen(tmp2);
        new 
string[128];
        if(
DOF2_FileExists(DOF2_File(tmp2))) return SendClientMessage(playeridred"That Name is already in use");
        if(
length || length MAX_PLAYER_NAME) return
        
SendClientMessage(playerid,red,"ERROR: Incorrect Name Length");
        if(
PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
        return 
SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
        {
            
strmid(VehicleInfo[PlayerInfo[player1][vowned]][owner], tmp20strlen(tmp2), 255);
            
strmid(VehicleInfo[PlayerInfo[player1][vowned2]][owner], tmp20strlen(tmp2), 255);
            
strmid(VehicleInfo[PlayerInfo[player1][vowned3]][owner], tmp20strlen(tmp2), 255);
            
strmid(VehicleInfo[PlayerInfo[player1][vowned4]][owner], tmp20strlen(tmp2), 255);
            
strmid(VehicleInfo[PlayerInfo[player1][vowned5]][owner], tmp20strlen(tmp2), 255);
            
strmid(VehicleInfo[PlayerInfo[player1][vowned6]][owner], tmp20strlen(tmp2), 255);
            
strmid(VehicleInfo[PlayerInfo[player1][vowned7]][owner], tmp20strlen(tmp2), 255);
            
strmid(VehicleInfo[PlayerInfo[player1][vowned8]][owner], tmp20strlen(tmp2), 255);
            new 
str1[256];
            new 
housenumber DOF2_GetInt(DOF2_File(tmp2), "Houseid");
            
format(str1sizeof(str1), "SATDM/Houses/houseid%d"housenumber);
            
dini_Set(str1"Name",tmp2);
            
strmid(HouseInfo[housenumber][Name],tmp2,sizeof(tmp2),255);
            new 
hnowner[30];
            
format(hnowner,128,"%s",HouseInfo[housenumber][Name]);
            if(
strcmp(HouseInfo[housenumber][Name],DEFAULT_OWNER,false) == 0) {
                
format(hnowner,128,"Not Owned");
            }
            
UpdateDynamic3DTextLabelText(HouseTextInfo[housenumber],0xFF0000FF,hnowner);
            new 
BizID PlayerInfo[player1][bowned];
            
strmid(BizInfo[BizID][owner], tmp20strlen(tmp2), 255);
            new 
bizowner[30];
            
format(bizowner,128,"%s",BizInfo[BizID][owner]);
            if(
strcmp(BizInfo[BizID][owner],DEFAULT_OWNER,false) == 0) {
                
format(bizowner,128,"Not Owned");
            }
            
UpdateDynamic3DTextLabelText(bizTextInfo[BizID],0xFF0000FF,bizowner);
            
DOF2_RenameFile(DOF2_File(PlayerName2(player1)), DOF2_File(tmp2));
            
SetPlayerName(player1tmp2);
            
CMDMessageToAdmins(playerid"CHANGENAME");
            
format(stringsizeof(string), "|- You have set \"%s's\" Name to \"%s\" -|"PlayerName2(player1), tmp2);
            
SendClientMessage(playeridbluestring);
            if(
player1 != playerid)
            {
                
format(string,sizeof(string),"|- Administrator \"%s\" has set your Name to \"%s\" -|"pName(playerid), tmp2);
                
SendClientMessage(player1,blue,string);
            }
               return 
OnPlayerConnect(player1);
        }
        else return 
SendClientMessage(playeridred"ERROR: Player is not connected");
    }
    else return 
SendClientMessage(playeridred"ERROR: You are not a high enough level to use this command");

There's no errors when I compile it, but when I change my name, it's just set my name and it don't transfer my stuffs from old acc to the new acc. What's wrong? BTW, it's from SATDM_v11
*Sorry for my bad English
Reply
#2

UP UP UP UP UP
Reply
#3

Are you using a linux host?
Reply
#4

bump,since i find this thing
Reply
#5

this cant and never will happen. you can't transfer the shit to accounts as you need to do that manually. the function called onplayerconnect will either register or login you, you can try doing it manually also call every function related to accounts whether it be onplayerspawn...etc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)