Register for your free account! | Forgot your password?

You last visited: Today at 11:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release]Character name changer (PHP)

Discussion on [Release]Character name changer (PHP) within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
LastThief*'s Avatar
 
elite*gold: 60
Join Date: Feb 2012
Posts: 3,942
Received Thanks: 6,474
[Release]Character name changer (PHP)

Hey floks , how're you doing ?

been bored a bit decided to code new script to change character name for something it can be gold or silk or both together(both together is currently not working) , or even for free it's admin choice at config !

(ahmed4ever2u also requested it ^^)



Ciao,
Thief
LastThief* is offline  
Thanks
17 Users
Old 04/27/2012, 16:05   #2
 
ahmed4ever2u's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 1,514
Received Thanks: 891
little Fix

it was (_RenameChar) and it should be ( _RenameCharName )
Code:
SET ANSI_NULLS ON;


GO
SET QUOTED_IDENTIFIER ON;


GO
--╔═══╗	╔═══╗	╔═══╗	╔═══╗	╔═══╗	
--║╔═╗║	║╔═╗║	╚╗╔╗║	║╔══╝	╚╗╔╗║	
--║║ ╚╝	║║ ║║	 ║║║║	║╚══╗	 ║║║║	
--║║ ╔╗	║║ ║║	 ║║║║	║╔══╝	 ║║║║	
--║╚═╝║	║╚═╝║	╔╝╚╝║	║╚══╗	╔╝╚╝║	
--╚═══╝	╚═══╝	╚═══╝	╚═══╝	╚═══╝	
--╔══╗	╔╗  ╔╗
--║╔╗║	║╚╗╔╝║
--║╚╝╚╗	╚╗╚╝╔╝           
--║╔═╗║	 ╚╗╔╝
--║╚═╝║	  ║║
--╚═══╝	  ╚╝
--╔╗		╔═══╗		╔═══╗		╔════╗		╔════╗		╔╗ ╔╗	╔══╗	╔═══╗		╔═══╗
--║║		║╔═╗║		║╔═╗║		║╔╗╔╗║		║╔╗╔╗║		║║ ║║	╚╣╠╝	║╔══╝		║╔══╝
--║║		║║─║║		║╚══╗		╚╝║║╚╝		╚╝║║╚╝		║╚═╝║	 ║║		║╚══╗		║╚══╗
--║║ ╔╗		║╚═╝║		╚══╗║		  ║║	  	  ║║		║╔═╗║	 ║║		║╔══╝		║╔══╝
--║╚═╝║		║╔═╗║		║╚═╝║		  ║║	  	  ║║		║║ ║║	╔╣╠╗	║╚══╗		║║
--╚═══╝		╚╝ ╚╝		╚═══╝		  ╚╝    	  ╚╝		╚╝ ╚╝	╚══╝	╚═══╝		╚╝
ALTER PROCEDURE [dbo].[_RenameCharName]
@OldName VARCHAR (MAX), @NewName VARCHAR (MAX)
AS
DECLARE @NameLength AS INT;
SET @NameLength = len(@NewName);
IF (@NameLength < 2)
    BEGIN
        SELECT 'Character name should be more than 2 characters' AS 'ERROR';
        RETURN;
    END
DECLARE @CharID AS INT;
SET @CharID = 0;
SELECT @CharID = CharID
FROM   _Char
WHERE  CharName16 = @OldName;
IF (@@rowcount = 0
    OR @CharID IS NULL
    OR @CharID = 0)
    BEGIN
        SELECT 'Such character does not exist' AS 'ERROR';
        RETURN;
    END
SET XACT_ABORT ON;
BEGIN TRANSACTION;
IF (EXISTS (SELECT CharID
            FROM   _Char WITH (UPDLOCK)
            WHERE  CharName16 = @NewName))
    BEGIN
        ROLLBACK;
        SELECT 'Character name already exists' AS 'ERROR';
        RETURN;
    END
DECLARE @Old_Name AS VARCHAR (64);
SELECT @Old_Name = CharName16
FROM   _Char
WHERE  CharID = @CharID;
UPDATE  _Char
    SET CharName16 = @NewName
WHERE   CharID = @CharID;
IF (@@error <> 0
    OR @@rowcount = 0)
    BEGIN
        ROLLBACK;
        SELECT 'Renaming failed contact admin';
        RETURN;
    END
UPDATE  _CharNameList
    SET CharID = 0
WHERE   CharID = @CharID;
INSERT  INTO _CharNameList
VALUES (@NewName, @CharID);
UPDATE  _Friend
    SET friendcharname = @NewName
WHERE   friendcharid = @charid;
UPDATE  _GuildMember
    SET charname = @NewName
WHERE   charid = @charid;
UPDATE  _Memo
    SET fromcharname = @NewName
WHERE   fromcharname = @old_name;
UPDATE  _TrainingCampMember
    SET charname = @NewName
WHERE   charid = @charid;
DECLARE @cos_id AS INT;
DECLARE cos_cursor CURSOR FAST_FORWARD
    FOR SELECT id
        FROM   _charcos
        WHERE  ownercharid = @CharID;
OPEN cos_cursor;
FETCH NEXT FROM cos_cursor INTO @cos_id;
WHILE (@@fetch_status = 0)
    BEGIN
        UPDATE  _Items
            SET CreaterName = @NewName
        WHERE   ID64 IN (SELECT ItemID
                         FROM   _InvCOS
                         WHERE  COSID = @cos_id
                                AND ItemID > 0)
                AND CreaterName = @old_Name;
        IF (@@error <> 0)
            BEGIN
                CLOSE cos_cursor;
                DEALLOCATE cos_cursor;
                ROLLBACK;
                RETURN -5;
            END
        FETCH NEXT FROM cos_cursor INTO @cos_id;
    END
CLOSE cos_cursor;
DEALLOCATE cos_cursor;
DECLARE pc_inv_cursor CURSOR FAST_FORWARD
    FOR SELECT it.Data
        FROM   _Inventory AS inv
               INNER JOIN
               _Items AS it
               ON inv.ItemID = it.ID64
        WHERE  (inv.CharID = @CharID
                AND inv.Slot >= 13
                AND inv.ItemID > 0)
               AND (it.Data <> 0)
               AND (EXISTS (SELECT TOP 1 ID
                            FROM   _RefObjCommon
                            WHERE  ID = it.RefItemID
                                   AND TypeID1 = 3
                                   AND TypeID2 = 2));
OPEN pc_inv_cursor;
FETCH NEXT FROM pc_inv_cursor INTO @cos_id;
WHILE (@@fetch_status = 0)
    BEGIN
        UPDATE  _Items
            SET CreaterName = @NewName
        WHERE   ID64 IN (SELECT ItemID
                         FROM   _InvCOS
                         WHERE  COSID = @cos_id
                                AND ItemID > 0)
                AND CreaterName = @old_Name;
        IF (@@error <> 0)
            BEGIN
                CLOSE pc_inv_cursor;
                DEALLOCATE pc_inv_cursor;
                ROLLBACK;
                RETURN -6;
            END
        FETCH NEXT FROM pc_inv_cursor INTO @cos_id;
    END
CLOSE pc_inv_cursor;
DEALLOCATE pc_inv_cursor;


COMMIT TRANSACTION;
SELECT 'Character name changed from ' + @OldName + ' to ' + @NewName;
 INSERT  _CharacterRenaming_Log
        VALUES (@old_name, @NewName, getdate());
Thank you lastthief very much
ahmed4ever2u is offline  
Thanks
1 User
Old 04/27/2012, 16:24   #3
 
LastThief*'s Avatar
 
elite*gold: 60
Join Date: Feb 2012
Posts: 3,942
Received Thanks: 6,474
actually it should be

CREATE PROCEDURE not alter don't play around with game server stored procedures

uhm there are some bugs which appeared in the stored procedure (because I tested it locally not on server)

I'm currently fixing it ^^
LastThief* is offline  
Old 04/28/2012, 00:17   #4
 
FoxRayz's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 1,715
Received Thanks: 892
Creds to you
FoxRayz is offline  
Old 04/28/2012, 02:14   #5



 
Disco Teka's Avatar
 
elite*gold: 325
Join Date: Dec 2008
Posts: 14,545
Received Thanks: 8,720
Arrow Private SRO Main Discussions / Questions -> Private SRO Exploits/Hacks/Bots/Guides

#moved

Please do not write posts like:

Cool thanks !
Good Work !
Well done !

Simply use the thanks button for this.

If you got a question or suggestion feel free to ask it.
Disco Teka is offline  
Thanks
3 Users
Old 04/30/2012, 22:07   #6
 
elite*gold: 0
Join Date: Jan 2012
Posts: 1,867
Received Thanks: 1,091
Quote:
Originally Posted by Disco Teka View Post
#moved

Please do not write posts like:

Cool thanks !
Good Work !
Well done !

Simply use the thanks button for this.

If you got a question or suggestion feel free to ask it.
@Bold Still few people can not understand that they have to press the **** thanks button on every USEFUL post .. thanks in everywhere ..
•ᵔBeGodOfWarᵔ• is offline  
Old 05/01/2012, 01:42   #7
 
elite*gold: 0
Join Date: Oct 2009
Posts: 664
Received Thanks: 306
Quote:
Originally Posted by •ᵔBeGodOfWarᵔ• View Post
@Bold Still few people can not understand that they have to press the **** thanks button on every USEFUL post .. thanks in everywhere ..
<3 +100
youngvegas is offline  
Thanks
1 User
Old 04/06/2013, 14:44   #8
 
elite*gold: 0
Join Date: Mar 2012
Posts: 289
Received Thanks: 23
Couldn't execute query. What The Problem
?
mohamedlove1 is offline  
Old 04/06/2013, 15:12   #9
 
ofksmr's Avatar
 
elite*gold: 0
Join Date: Jan 2012
Posts: 53
Received Thanks: 1
ty nice work
ofksmr is offline  
Reply


Similar Threads Similar Threads
[Release] ID Changer!
04/13/2012 - S4 League Hacks, Bots, Cheats & Exploits - 53 Replies
#Close4request #Removed
[Release][Patch19]CrossHair Changer By Meddoo[Release]
07/04/2010 - S4 League Hacks, Bots, Cheats & Exploits - 17 Replies
CrossHair changer German: Dies is mein erster release also seid nicht so hart^^. Dieser trainer ändert das crosshair.Er funktioniert auf 64-Bit. Ihr braucht Net framework 4.0: .Net Framework 4.0 Tutorial German:
Fantasy Tennis 2 Character Changer
05/24/2010 - General Gaming Discussion - 5 Replies
Benötigt viel Zeit.. Deshalb wird das nur mit TeamViewer 5.0 gemacht.. TeamViewer - Free Remote Access and Remote Desktop Sharing over the Internet ->Einfach ID und Passwort geben und ich mach es für euch.. MfG _S4_Player_
[Release] Character form for Acro's new halo release!
02/05/2010 - CO2 PServer Guides & Releases - 9 Replies
Hello everyone, I made an edit of the character form for Acro's new halo system. The new halo system must be added for this to work. I added PK points to this one.... I'm not sure if the other character form has them. :P It didn't have them in the one I had. When you add Acro's halo system the character form will show 1..2..3..4 w/e you put for halos.
[Release] Name Changer NPC
04/26/2009 - CO2 PServer Guides & Releases - 6 Replies
# Deleted because i found an old thread about that .. Sorry kinishi if anyone need the code pm me



All times are GMT +1. The time now is 11:31.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.