Jump to content
  • 0

how to disable @warp and @go command when you are at sleep status?


Brynner

Question


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

how can i disable using @warp and @go command if you are under status of trickdead?

 

the novice can use Trick Dead skill and they can use @warp and @go commands.i just want to disable it. they should be back to normal status to use the @warp and @go commands. thanks in advance.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

You need just to add simple checking

ACMD_FUNC(go)
{
	int i;
	int town;
	char map_name[MAP_NAME_LENGTH];
	int16 m;
+	struct status_change *sc;

..........
	nullpo_retr(-1, sd);

+	sc = status_get_sc(sd);
+
+	if (sc->data[SC_TRICKDEAD]) {
+		clif_displaymessage(sd->fd,"You can't use this command under Trick Dead effect");
+		return 0;
+	}

similarly with @warp

 

Error 1 error C2065: 'sc'

sc = status_get_sc(sd);

if (sc->data[sC_TRICKDEAD]) {

Error 5 error C2223: left of '->data' must point to struct/union

if (sc->data[sC_TRICKDEAD]) {

 

i got these error

by the way problem solve.

 

just remove the sc = status_get_sc(sd);

 

and simply change the 

 

if (sc->data[sC_TRICKDEAD])

to

if (sd->sc.data[sC_TRICKDEAD])

 

thanks for showing how it works.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  143
  • Reputation:   30
  • Joined:  12/23/11
  • Last Seen:  

You need just to add simple checking

ACMD_FUNC(go)

{

int i;

int town;

char map_name[MAP_NAME_LENGTH];

int16 m;

+ struct status_change *sc;

..........

nullpo_retr(-1, sd);

+ sc = status_get_sc(sd);

+

+ if (sc->data[SC_TRICKDEAD]) {

+ clif_displaymessage(sd->fd,"You can't use this command under Trick Dead effect");

+ return 0;

+ }

similarly with @warp
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  143
  • Reputation:   30
  • Joined:  12/23/11
  • Last Seen:  

Are you sure that you added this line:

struct status_change *sc;

?
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...