Jump to content
  • 0

Need source code's for some @command.


vijay30393

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

Hello guys, like i said, i need source code's for @command they are:

1) @auraset (I have some custom aura on my server and i need to set the aura to a particular player permanently, and the aura's are in the form of items like potions, is there are way to set the aura to a player?)

2) @freez (This command must freeze's him self at the spot where he is)

3) @freezall (This command must freeze's all player at the spot where they are [This must be a gm command])

4) @unfreezall (This command must unfreeze's all players and kick them out of the server who had been freeze'n before [This must be a gm command])

Thats all i want people, please do help me i seriously need the code, help me out guys.........

Thanking you

(Vijay Kumar)

Link to comment
Share on other sites

13 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

@freez

ACMD_FUNC(freez)

{

nullpo_retr(-1, sd);

sd->sc.opt1 = 10;

return 0;

}

@freezall

ACMD_FUNC(freezall)
{
  struct map_session_data* pl_sd;
  struct s_mapiterator* iter;
  nullpo_retr(-1, sd);

  iter = mapit_getallusers();
  for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
  {
     if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // only lower or same gm level?
        if (sd->status.account_id != pl_sd->status.account_id)
            pl_sd->sc.opt1 = 10;
     }
   }
  mapit_free(iter);
  return 0;
}

@unfreezeall


ACMD_FUNC(unfreezeall)
{
  struct map_session_data* pl_sd;
  struct s_mapiterator* iter;
  nullpo_retr(-1, sd);

  iter = mapit_getallusers();
  for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
  {
     if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // only lower or same gm level?
        if (sd->status.account_id != pl_sd->status.account_id && pl_sd->sc.opt1 == 10;){
            clif_GM_kick(NULL, pl_sd);
        }
     }
   }
  mapit_free(iter);
  return 0;
}

finally

ACMD_DEF(freez),
ACMD_DEF(freezall),
ACMD_DEF(unfreezall),

never been tested..anyway if it doesn't work don't bother to ask.. :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

@Malufett

Im very thank full to you, can i add you on msn please? i needed some help.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  231
  • Reputation:   9
  • Joined:  12/16/11
  • Last Seen:  

Anyway to put a effect like a frozen effect?

How about @freezeoff?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

Im very thank full to you, can i add you on msn please? i needed some help.

your welcome..yes you can..but ATM just pm me..I just broke my MSN that is why I can't OL in MSN

Anyway to put a effect like a frozen effect?

How about @freezeoff?

just change sd->sc.opt1 = 10; to sd->sc.opt1 = OPT1_FREEZE;

and for @freezeoff

just copy the @freeze then change sd->sc.opt1 = 10; to sd->sc.opt1 &= ~10; or sd->sc.opt1 &= ~OPT1_FREEZE;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  231
  • Reputation:   9
  • Joined:  12/16/11
  • Last Seen:  

Sorry sir malufett. The frozen effect is not working. :((

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

im newbi with the coding, can you please do it for me on teamviewer? its hard to ask like this... but still i gotta ask.

check this out error.

error.png

And if cant teamviewer here is my scr file ty.

https://dl.dropbox.c...4554687/mmo.rar

Edited by Emistry
Make use of [IMG] Tag
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  231
  • Reputation:   9
  • Joined:  12/16/11
  • Last Seen:  

Sir, Malufett

The problem is that I need to refresh my character to see the effect. How to see the effect without refreshing or reconnecting the character?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  02/27/12
  • Last Seen:  

this commands is very old and i used on my server later i will upload on how to

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

@Cuspid

I forgot..add this after it...'clif_changeoption(&sd->bl);' or 'clif_changeoption(&pl_sd->bl);'

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  231
  • Reputation:   9
  • Joined:  12/16/11
  • Last Seen:  

@malufett How about the @freezeall and @unfreezeall for 3ceam?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

They will be the sae for 3ceam or Ea, you just need to change the declaration part :

ACMD_DEF(freez),

to

{ "freez", 60,60, atcommand_freez},

but it ain't a 3ceam forum here, plus since it was merged there no really point kepping it.

@malufett, dunno if I would force check sd for freezall and unfreezall, make sense for player usage but may be a bother if he planing using it from a script.

So in short I would only check the level thing if we have a player attach otherwise do it for all..

ACMD_FUNC(freezall)
{
  struct map_session_data* pl_sd;
  struct s_mapiterator* iter;

  iter = mapit_getallusers();
  for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
  {
	  if (sd && (pc_get_group_level(sd) < pc_get_group_level(pl_sd)  || sd->status.account_id == pl_sd->status.account_id)
	   ) {
			 continue;   //skip it if we have someone attach and his lower gmlvl than the other.					  
	  } //(perhaps we should check groupid instead or add a new permission..)		  
	  pl_sd->sc.opt1 = 10;
	  clif_changeoption(&pl_sd->bl);
  }
  mapit_free(iter);
  return 0;
}

Edited by Lighta
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  231
  • Reputation:   9
  • Joined:  12/16/11
  • Last Seen:  

Fixed! :)

How about only in a specific map to freeze all the players? like @freezemap?

Edited by Cuspid
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

do you want to specify the mapname or just current map ?

anyway assuming you giving a mapname :

ACMD_FUNC(freezall)
{
  struct map_session_data* pl_sd;
  struct s_mapiterator* iter;
  int map_id=0;
  char map_name[MAP_NAME_LENGTH_EXT] = "";
  bool chkmap = 1;

  if (sscanf(message, "%15s", map_name) < 1 || (map_id = map_mapname2mapid(map_name)) < 0){
   chkmap=0; //no valid map found do not chk it
  }

  iter = mapit_getallusers();
  for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
  {
			  if (sd && (pc_get_group_level(sd) < pc_get_group_level(pl_sd)  || sd->status.account_id == pl_sd->status.account_id)
				 || (chkmap && pl_sd->bl.m != map_id)
			   ) {
							 continue;   //skip it if we have someone attach and his lower gmlvl than the other.									  
			  } //(perhaps we should check groupid instead or add a new permission..)				
			  pl_sd->sc.opt1 = 10;
			  clif_changeoption(&pl_sd->bl);
  }
  mapit_free(iter);
  return 0;
}

There you go just adapt it for freezmap or whatever right now if you don't give him a map (or it's an invalid one) he would freeze them all (like before).

You can just check other atcommand for thoses adds actually.

Edited by Lighta
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...