How to add GM

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    QuoteShiek Member NanayaQ is offline
    MemberRank
    Jul 2012 Join Date
    791Posts

    How to add GM

    Ok I spent over 3 hours inputting some GM account but I have found a easy way to do it, here the input i wrote.
    Code:
    Insert Into auth
    (userid,zoneid,rid)
    Values
    (1,904,1)
    userid = your account id
    rid = your character role id
    after you input this restart either mssql/mysql(linux) or both and if that don't work restart your computer its will work. GM will be infront of your character name.
    capture.jpg
    -------
    OR
    -------
    OzzyGT's GM Query
    Code:
    USE [PassportBOIOLD]   <----- input your database name
    GO
    
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    
    CREATE PROCEDURE [dbo].[addGM] 
    	@name varchar(64) = NULL
    AS
    BEGIN
    	DECLARE @id int
    	DECLARE @rid int = 0
    	
    	BEGIN TRAN
    		SELECT @id=id FROM account WHERE name = @name
    				
    		IF (@id IS NOT NULL)  
    		BEGIN
    			WHILE (@rid < 12)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1					
    			END			
    			SET @rid = 100;
    			WHILE (@rid < 106)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1
    			END
    			SET @rid = 200;
    			WHILE (@rid < 215)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1
    			END	
    			SET @rid = 500;
    			WHILE (@rid < 519)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1
    			END		
    			
    			UPDATE account SET usertype = 131072 WHERE id = @id 				
    		END
    	COMMIT TRAN		
    END
    GO
    remove GM
    Code:
    USE [PassportBOIOLD]
    GO
    
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE PROCEDURE [dbo].[removeGM] 
    	@name varchar(64) = null
    AS
    BEGIN
    	DECLARE @id int
    		
    	BEGIN TRAN
    		SELECT @id=id FROM account WHERE name = @name
    		IF (@id IS NOT NULL)
    		BEGIN
    			DELETE FROM auth WHERE userid = @id
    			UPDATE account SET usertype = 0 WHERE id = @id 			
    		END 
    	COMMIT TRAN	
    END
    
    GO
    Just put them in a new query windows and execute them, aftewards you can use this to add or remove a GM:

    EXEC addGM 'username'
    EXEC removeGM 'username'
    Video tutorial on adding GM
    http://www.mediafire.com/?muamar67dpprrcz
    http://www.mediafire.com/?8p1dp2bzp02zczp


    Credit: Kev, OzzyGT and whoever that made the gm script.
    Last edited by NanayaQ; 15-08-12 at 10:04 PM.


  2. #2
    Member OzzyGT is offline
    MemberRank
    Aug 2012 Join Date
    99Posts

    Re: How to add GM

    It's weird that it works for you, the number 131072 is supposed to go in the usertype in the account table.

    I found that the "rid" field in the auth table is the role id, meaning that depending on what role id the user have, the permissions he gets as GM.

    I don't know exactly the relation between the role id and the permission but I think it's safer to put all of them, based in what reflax posted in another thread, I made this two stored procedures:

    Code:
    USE [PassportBOIOLD]
    GO
    
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    
    CREATE PROCEDURE [dbo].[addGM] 
    	@name varchar(64) = NULL
    AS
    BEGIN
    	DECLARE @id int
    	DECLARE @rid int = 0
    	
    	BEGIN TRAN
    		SELECT @id=id FROM account WHERE name = @name
    				
    		IF (@id IS NOT NULL)  
    		BEGIN
    			WHILE (@rid < 12)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1					
    			END			
    			SET @rid = 100;
    			WHILE (@rid < 106)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1
    			END
    			SET @rid = 200;
    			WHILE (@rid < 215)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1
    			END	
    			SET @rid = 500;
    			WHILE (@rid < 519)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1
    			END		
    			
    			UPDATE account SET usertype = 131072 WHERE id = @id 				
    		END
    	COMMIT TRAN		
    END
    GO
    Code:
    USE [PassportBOIOLD]
    GO
    
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE PROCEDURE [dbo].[removeGM] 
    	@name varchar(64) = null
    AS
    BEGIN
    	DECLARE @id int
    		
    	BEGIN TRAN
    		SELECT @id=id FROM account WHERE name = @name
    		IF (@id IS NOT NULL)
    		BEGIN
    			DELETE FROM auth WHERE userid = @id
    			UPDATE account SET usertype = 0 WHERE id = @id 			
    		END 
    	COMMIT TRAN	
    END
    
    GO
    Just put them in a new query windows and execute them, aftewards you can use this to add or remove a GM:

    EXEC addGM 'username'
    EXEC removeGM 'username'

    It seems that you need to restart the server for the changes to make effect.

  3. #3
    QuoteShiek Member NanayaQ is offline
    MemberRank
    Jul 2012 Join Date
    791Posts

    Re: How to add GM

    Quote Originally Posted by OzzyGT View Post
    It's weird that it works for you, the number 131072 is supposed to go in the usertype in the account table.

    I found that the "rid" field in the auth table is the role id, meaning that depending on what role id the user have, the permissions he gets as GM.

    I don't know exactly the relation between the role id and the permission but I think it's safer to put all of them, based in what reflax posted in another thread, I made this two stored procedures:

    Code:
    USE [PassportBOIOLD]
    GO
    
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    
    CREATE PROCEDURE [dbo].[addGM] 
    	@name varchar(64) = NULL
    AS
    BEGIN
    	DECLARE @id int
    	DECLARE @rid int = 0
    	
    	BEGIN TRAN
    		SELECT @id=id FROM account WHERE name = @name
    				
    		IF (@id IS NOT NULL)  
    		BEGIN
    			WHILE (@rid < 12)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1					
    			END			
    			SET @rid = 100;
    			WHILE (@rid < 106)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1
    			END
    			SET @rid = 200;
    			WHILE (@rid < 215)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1
    			END	
    			SET @rid = 500;
    			WHILE (@rid < 519)
    			BEGIN
    				INSERT INTO auth VALUES (@id,904,@rid)
    				SET @rid = @rid + 1
    			END		
    			
    			UPDATE account SET usertype = 131072 WHERE id = @id 				
    		END
    	COMMIT TRAN		
    END
    GO
    Code:
    USE [PassportBOIOLD]
    GO
    
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE PROCEDURE [dbo].[removeGM] 
    	@name varchar(64) = null
    AS
    BEGIN
    	DECLARE @id int
    		
    	BEGIN TRAN
    		SELECT @id=id FROM account WHERE name = @name
    		IF (@id IS NOT NULL)
    		BEGIN
    			DELETE FROM auth WHERE userid = @id
    			UPDATE account SET usertype = 0 WHERE id = @id 			
    		END 
    	COMMIT TRAN	
    END
    
    GO
    Just put them in a new query windows and execute them, aftewards you can use this to add or remove a GM:

    EXEC addGM 'username'
    EXEC removeGM 'username'

    It seems that you need to restart the server for the changes to make effect.
    i know its kinda weird yet it work like a charm and thanks for posting the new query :)

  4. #4
    Member OzzyGT is offline
    MemberRank
    Aug 2012 Join Date
    99Posts

    Re: How to add GM

    No problem but if it works with your query, that's a lot easier.

  5. #5
    QuoteShiek Member NanayaQ is offline
    MemberRank
    Jul 2012 Join Date
    791Posts

    Re: How to add GM

    Quote Originally Posted by OzzyGT View Post
    No problem but if it works with your query, that's a lot easier.
    yeah it works..

  6. #6
    Valued Member western is offline
    MemberRank
    Mar 2008 Join Date
    ArgentinaLocation
    113Posts

    Re: How to add GM

    I've trying NanayaQ way, restart mssql, restart the pc, but no results.

  7. #7
    Enthusiast Merrcy. is offline
    MemberRank
    Sep 2010 Join Date
    NewYorkLocation
    42Posts

    Re: How to add GM

    Thanks for this helped a lot.

  8. #8
    QuoteShiek Member NanayaQ is offline
    MemberRank
    Jul 2012 Join Date
    791Posts

    Re: How to add GM

    Quote Originally Posted by western View Post
    I've trying NanayaQ way, restart mssql, restart the pc, but no results.
    I am making a tutorial right now on How to add GM.. :)

  9. #9
    Enthusiast Merrcy. is offline
    MemberRank
    Sep 2010 Join Date
    NewYorkLocation
    42Posts

    Re: How to add GM

    Quote Originally Posted by NanayaQ View Post
    I am making a tutorial right now on How to add GM.. :)
    Try talking this time?? LoL

  10. #10
    QuoteShiek Member NanayaQ is offline
    MemberRank
    Jul 2012 Join Date
    791Posts

    Re: How to add GM

    Quote Originally Posted by ChrozSmooth View Post
    Try talking this time?? LoL
    I am on my laptop and it don't have a built-in mic so yeah... plus my desktop is mess up so I am fixing it atm.

    adding Gm should be very easy even w/o my tutorial. :)

  11. #11
    Apprentice AccountLost is offline
    MemberRank
    Sep 2012 Join Date
    6Posts

    Re: How to add GM

    Make sure your zoneid in auagent.conf is the same as the one in auth table. my zoneid in conf file was 3 so the GM stuff didn't work for me because this tutorial adds zone as 904

  12. #12
    Enthusiast UnknownGr is offline
    MemberRank
    Sep 2012 Join Date
    26Posts

    Re: How to add GM

    @ NanayaQ: hey man! I'm using VMware to run the server offline ... can u tell me which file I have to edit, because the way u guy setup the server is alot different to us.[ sorry for my bad English]

  13. #13
    QuoteShiek Member NanayaQ is offline
    MemberRank
    Jul 2012 Join Date
    791Posts

    Re: How to add GM

    Quote Originally Posted by UnknownGr View Post
    @ NanayaQ: hey man! I'm using VMware to run the server offline ... can u tell me which file I have to edit, because the way u guy setup the server is alot different to us.[ sorry for my bad English]
    well it dont matter if you use VMware or Vbox it matter how you set it up and it has to do with the SQL server, its the same method nothing has change unless you or someone change it somehow? (dunno) Other than that just copy the codes/paste it and excutted on SQL server YourBoiDatabase and Make sure to change the database name into your database name.

  14. #14
    Enthusiast UnknownGr is offline
    MemberRank
    Sep 2012 Join Date
    26Posts

    Re: How to add GM



    Help !!! my development skill is very poor.

  15. #15
    QuoteShiek Member NanayaQ is offline
    MemberRank
    Jul 2012 Join Date
    791Posts

    Re: How to add GM

    Quote Originally Posted by UnknownGr View Post


    Help !!! my development skill is very poor.
    Use Ozzy Method its way better and complex then mine, because you can add or remove GM use his script.



Page 1 of 2 12 LastLast

Advertisement