SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/08/2012, 02:33 PM   #1
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,846
Reputation: 310
Default /changename something is wrong

I don't understand why /changename sets the targetid password to 56
Even i mash the password. If you need info, more info will come tomorrow
i'm to sleepy now.

Post the code if find the working command (ofc, i will help myself too)

pawn Code:
CMD:changename(playerid, params[])
{
    new string[128],
        newname[MAX_PLAYER_NAME],
        oldname[MAX_PLAYER_NAME],
        location[254],
        id;
    if(pData[playerid][Login] == 0) return SendClientMessage(playerid, COLOR_RED, "*** Please login first! ***");
    if(pData[playerid][Admin] < 3) return SendClientMessage(playerid, COLOR_RED, "*** You are not Junior Administrator ***");
    if(sscanf(params, "us[24]", id, newname)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /changename [playerid] [newname]");
    if(pData[playerid][Admin] < pData[id][Admin]) return SendClientMessage(playerid, COLOR_RED, "*** You cannot change the name of higher administrator! ***");
    format(location, 254, pPath, newname);
    format(oldname,  MAX_PLAYER_NAME, "%s", dini_Get(DataPath(id), "Name"));
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "*** Player not connected ***");
    if(pData[playerid][Admin] < pData[id][Admin]) return SendClientMessage(playerid, COLOR_RED, "*** You cannot change name higher administrator! ***");
    if(fexist(location))
    {
        SendClientMessage(playerid, COLOR_RED, "*** That player name exists or you're changing the newname to a oldname ***");
    }
    else
    {
        format(string, sizeof(string), "Administrator %s(%d) has change %s name to %s(%d)", GetpName(playerid), playerid, GetpName(id), newname, id);
        SendClientMessageToAll(COLOR_GREEN, string);
        format(string, sizeof(string), "*** You change %s name to %s(%d)", GetpName(id), newname, id);
        SendClientMessage(playerid, COLOR_GREEN, string);
        format(string, sizeof(string), "*** Administrator %s(%d) has change your name to %s", GetpName(playerid), playerid, newname);
        SendClientMessage(id, COLOR_GREEN, string);
        format(pData[id][Pass], 100, "%s", dini_Get(DataPath(id), "Password"));
        pData[id][Jail] = dini_Int(DataPath(id), "Jail");
        new jailreason[92];
        format(jailreason, 92, "%s", dini_Get(DataPath(id), "JailReason"));
        new jailby[24];
        format(jailby, 24, "%s", dini_Get(DataPath(id), "JailBy"));
        pData[id][Mute] = dini_Int(DataPath(id), "Mute");
        new mutereason[92];
        format(mutereason, 92, "%s", dini_Get(DataPath(id), "MuteReason"));
        new muteby[24];
        format(muteby, 24, "%s", dini_Get(DataPath(id), "MuteBy"));
        pData[id][NoPM] = dini_Int(DataPath(id), "NoPM");
        pData[id][Banned] = dini_Int(DataPath(id), "Banned");
        new banreason[92];
        format(banreason, 92, "%s", dini_Get(DataPath(id), "Reason"));
        new banby[24];
        format(banby, 24, "%s", dini_Get(DataPath(id), "BanBy"));
        pData[id][Skin] = dini_Int(DataPath(id), "Skin");
        pData[id][UseSkin] = dini_Int(DataPath(id), "UseSkin");
        pData[id][Admin] = dini_Int(DataPath(id), "Admin");
        pData[id][VIP] = dini_Int(DataPath(id), "VIP");
        pData[id][Score] = dini_Int(DataPath(id), "Score");
        pData[id][Cookies] = dini_Int(DataPath(id), "Cookies");
        pData[id][Cash] = dini_Int(DataPath(id), "Cash");
        pData[id][Deaths] = dini_Int(DataPath(id), "Deaths");
        pData[id][Kills] = dini_Int(DataPath(id), "Kills");
        dini_Remove(DataPath(id));
        dini_Create(location);
        dini_Set(location, "Name", newname);
        dini_Set(location, "IP", IP);
        dini_IntSet(location, "Password", pData[id][Pass]);
        dini_IntSet(location, "Jail", pData[id][Jail]);
        dini_Set(location, "JailReason", jailreason);
        dini_Set(location, "JailBy", jailby);
        dini_IntSet(location, "Mute", pData[id][Mute]);
        dini_Set(location, "MuteReason", mutereason);
        dini_Set(location, "MuteBy", muteby);
        dini_IntSet(location, "NoPM", pData[id][NoPM]);
        dini_IntSet(location, "Banned", pData[id][Banned]);
        dini_Set(location, "Reason", banreason);
        dini_Set(location, "BanBy", banby);
        dini_IntSet(DataPath(playerid), "Skin", pData[id][Skin]);
        dini_IntSet(DataPath(playerid), "UseSkin", pData[id][UseSkin]);
        dini_IntSet(location, "Admin", pData[id][Admin]);
        dini_IntSet(location, "VIP", pData[id][VIP]);
        dini_IntSet(location, "Score", pData[id][Score]);
        dini_IntSet(location, "Cookies", pData[id][Cookies]);
        dini_IntSet(location, "Cash", pData[id][Cash]);
        dini_IntSet(location, "Deaths", pData[id][Deaths]);
        dini_IntSet(location, "Kills", pData[id][Kills]);
        SetPlayerName(id, newname);
        format(string, sizeof(string), "ADMMSG: Administrator %s(%d) has use /changename to %s(%d) | New Name: %s", GetpName(playerid), playerid, GetpName(id), id, newname);
        ReadADMCMD(playerid, COLOR_BLUE, string);
    }
    return 1;
}
__________________
Need help regarding to script? Email me by pressing this. You could find me playing at SA-MP's Project-LA, as a Senior Moderator, Ronald Lacson.

[FS] JakAdmin 3.2.1 (0.3z)
Got new unique ideas for my JakAdmin? PM me or post a suggestion on the JakAdmin topic.

#adventuretime, Jake Hero #yadayada

_Jake_ is offline   Reply With Quote
Old 10/08/2012, 03:28 PM   #2
airplanesimen
Huge Clucker
 
airplanesimen's Avatar
 
Join Date: Nov 2011
Location: Narvik, Norway
Posts: 433
Reputation: 21
Default Re: /changename something is wrong

huh, sounds wierd. changing the password u say?
__________________

Get a cheap host here (click)
Check out our forums! --> www.ogs-forum.com
airplanesimen is offline   Reply With Quote
Old 11/08/2012, 01:48 AM   #3
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,846
Reputation: 310
Default Re: /changename something is wrong

Ok more info coming...

Here is little example of /changename problem

Example on the folder rServer/Users/
My file in rServer/Users is Romel.ini.
If i use /changename romel romel_jakebuns
it deletes the file (its normal) then creates new file
containing all stats from Romel.ini, but when i check
the line password it says something like this

Code:
Password=56
it must be something like this

Code:
Password=F9CC8C5BEAC2191D52A1650B3268FC099D23114EF8F2A1C1B181A8E891E79299284CFEB35F61CFD47C1E56A2A79E0F86F1409A38EBE22B65187EF19D2D040CA4
weird?
__________________
Need help regarding to script? Email me by pressing this. You could find me playing at SA-MP's Project-LA, as a Senior Moderator, Ronald Lacson.

[FS] JakAdmin 3.2.1 (0.3z)
Got new unique ideas for my JakAdmin? PM me or post a suggestion on the JakAdmin topic.

#adventuretime, Jake Hero #yadayada

_Jake_ is offline   Reply With Quote
Old 11/08/2012, 05:11 AM   #4
[MM]RoXoR[FS]
Gangsta
 
[MM]RoXoR[FS]'s Avatar
 
Join Date: Mar 2012
Location: Gurgaon,India
Posts: 745
Reputation: 137
Default Re: /changename something is wrong

You see Password aint INT
pawn Code:
dini_IntSet(location, "Password", pData[id][Pass]);

You must use whirlpool.
__________________
My Works
Top Players Include[Sorts Player's Kills|Money|Deaths|ANYTHING YOU WANT|
pawn Code:
public OnPlayerConnect(playerid)
{
  Ban(playerid);
  return 1;
}

Scripting for Money
[MM]RoXoR[FS] is offline   Reply With Quote
Old 11/08/2012, 05:12 AM   #5
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,846
Reputation: 310
Default Re: /changename something is wrong

I'm using Whirlpool ^_^
Let me try if it work.

I will change it dini_IntSet to Set?

Edit: Ty, It work.
__________________
Need help regarding to script? Email me by pressing this. You could find me playing at SA-MP's Project-LA, as a Senior Moderator, Ronald Lacson.

[FS] JakAdmin 3.2.1 (0.3z)
Got new unique ideas for my JakAdmin? PM me or post a suggestion on the JakAdmin topic.

#adventuretime, Jake Hero #yadayada

_Jake_ is offline   Reply With Quote
Old 11/08/2012, 06:23 AM   #6
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,846
Reputation: 310
Default Re: /changename something is wrong

I notice another problem.
When you /changename.
Ex.

i change name myself to Dog_Jake

my Admin/VIP Level will be lost and i have to rcon login and make myself as admin/vip.

How to fix it?
__________________
Need help regarding to script? Email me by pressing this. You could find me playing at SA-MP's Project-LA, as a Senior Moderator, Ronald Lacson.

[FS] JakAdmin 3.2.1 (0.3z)
Got new unique ideas for my JakAdmin? PM me or post a suggestion on the JakAdmin topic.

#adventuretime, Jake Hero #yadayada

_Jake_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/changename Crazyboobs Scripting Help 0 02/07/2012 05:57 AM
Changename miley1 General 4 16/05/2012 02:02 PM
/changename - How? L0zaix Scripting Help 15 19/02/2012 10:34 AM
Help me with /changename Rudyy Help Archive 1 02/10/2010 12:31 PM


All times are GMT. The time now is 05:40 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.