[RELEASE] Scripts for Gmcmd.cpp

Guides for osRose and osiRose (compilation / setup)...

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[RELEASE] Scripts for Gmcmd.cpp

Postby fransh on Mon Feb 21, 2011 4:30 pm

Updated in 13/3/'11
I've made this section just because I haven't seen one in here, this is the place you can give your command scripts for open use to servers


Adds a [GM]Tag in front of the users name - Coded by FransH

  1. else if (strcmp(command,"gmtag")==0) /*  - Made by FransH - adds a gm tag - Relog needed*/
  2.     {
  3.  if(Config.Command_Ban > thisclient->Session->accesslevel) //*Works on acceslevel of ban so you don't have to change headers
  4.            return true;
  5.  
  6.                  char newcharname[65];
  7.                  strcpy (newcharname,"[GM]");  //Change this value if you want
  8.                  strcat (newcharname, thisclient->CharInfo->charname);
  9.                   GServer->DB->QExecute(" UPDATE characters SET char_name = '%s' WHERE id = '%i' ",newcharname, thisclient->CharInfo->charid);
  10.       }




We have /rules, but not /gmrule, this shows the basic rules for (Starter) gm's. - Main code by Matt and edited by FransH for other use.

  1.  
  2. else if (strcmp(command, "gmrules")==0)  //Main code by Matt, edited by FransH.
  3.     {
  4.         if(Config.Command_ban > thisclient->Session->accesslevel)//works on ban so no need to edit headers!
  5.            return true;
  6.       SendPM(thisclient, "Follow these rules or you might lose your acceslevel!"); //Change these if you like
  7.             SendPM(thisclient, "Rule 1: Do not give items to other (normal) players");
  8.             SendPM(thisclient, "Rule 2: Don't abuse your powers");
  9.             SendPM(thisclient, "Rule 3: Respect the administrators");
  10.             SendPM(thisclient, "Rule 4: No spawning of any monsters in any towns");
  11.             SendPM(thisclient, "Rule 5: Don't teleport people for fun");
  12.             SendPM(thisclient,  "~ADMINS CAN DECIDE IF IT IS OKAY AT ALL TIME~.")
  13.     }




So, where should I place them, then?

Placing these codes is easy, every new command starts with like
  1. else if (strcmp(command, "gmrules")==0)
, so place your code above that one, make sure to end it with }. If you still do not understand, please post.
-------------------------------------------------------------------------
Updates:
Fixed a code starting out with half words (Copy-mistake)
Added 'where to place' section
-------------------------------------------------------------------------
:mrgreen: We are looking for new codes, help the community and reply with the code uploaded in mediafire as a .txt in a .rar - Thank you :mrgreen:
Last edited by fransh on Sun Mar 13, 2011 12:44 pm, edited 3 times in total.
fransh
Smoulie
Smoulie
 
Posts: 34
Joined: Fri Jul 09, 2010 10:38 am

Re: [RELEASE] Command scripts for gmcmd

Postby merlon on Thu Mar 03, 2011 4:44 am

maybe you should put where exactly to put this code in...
User avatar
merlon
Antares
Antares
 
Posts: 359
Joined: Fri Jul 09, 2010 2:15 pm

Re: [RELEASE] Command scripts for gmcmd

Postby PurpleYouko on Thu Mar 03, 2011 2:51 pm

Seems like gmcommands.cpp would be a good choice :?
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: [RELEASE] Command scripts for gmcmd

Postby merlon on Thu Mar 03, 2011 5:34 pm

I know but other noobies may need help
User avatar
merlon
Antares
Antares
 
Posts: 359
Joined: Fri Jul 09, 2010 2:15 pm

Re: [RELEASE] Scripts for Gmcmd.cpp

Postby fransh on Sun Mar 13, 2011 12:43 pm

Updated, thanks for the feedback.
fransh
Smoulie
Smoulie
 
Posts: 34
Joined: Fri Jul 09, 2010 10:38 am

Re: [RELEASE] Scripts for Gmcmd.cpp

Postby hoegarden31 on Sat Feb 18, 2012 8:30 pm

Hello, sorry to bring this topic up, but i see you use the Config.Command_ban...
that's all nice, but i want to add my own one. So i added a new line in the command.ini file, added a new int ni the socket.h file, but it's not working... did i miss a file ? If yes, please tell me wich one :D
I'm the one and only. In heaven and on earth.
Image
hoegarden31
Rackie
Rackie
 
Posts: 150
Joined: Sun Nov 13, 2011 7:13 pm

Re: [RELEASE] Scripts for Gmcmd.cpp

Postby PurpleYouko on Mon Feb 20, 2012 3:03 pm

You would have to define the config command in Sockets.h then actually load the value in WorldServer.cpp.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: [RELEASE] Scripts for Gmcmd.cpp

Postby hoegarden31 on Mon Feb 20, 2012 8:06 pm

ah yeah, thanks :D

Didn't know what file it was. So as a fix i added the number direct on the command. But it's ok now. It's all working :D
I'm the one and only. In heaven and on earth.
Image
hoegarden31
Rackie
Rackie
 
Posts: 150
Joined: Sun Nov 13, 2011 7:13 pm


Return to osRose / osiRose Guides

Who is online

Users browsing this forum: No registered users and 3 guests

cron