Jump to content
  • 0

Emperium Breakers name


Question

Posted

announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [" + strcharinfo(0) + "] from the [" + getguildName(.@GID) + "] guild.",bc_all;

but i get this error

[Debug]: script_rid2sd: fatal error ! player not attached!
[Warning]: script:get_val: cannot access player variable 'killerid' defaulting to 0

And it doesnt shows even the guild that conquered the castle (shows nothing)

i am using eathena svn

3 answers to this question

Recommended Posts

Posted (edited)

there's no player Attached so strcharinfo(0) obviously doesn't work :P. please show us more of the code so we can help you.

edit:

change

// Respawn the Emperium, and display new owners.
sleep 500; // Slow down script execution slightly.
if( agitcheck() )
	donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
sleep 7000;

announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [" + strcharinfo(0) + "] from the [" + getguildName(.@GID) + "] guild.",bc_all;

end;

to

// Respawn the Emperium, and display new owners.
sleep2 500; // Slow down script execution slightly.
if( agitcheck() )
	donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
sleep2 7000;

announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [" + strcharinfo(0) + "] from the [" + getguildName(.@GID) + "] guild.",bc_all;

end;

The players RID detaches because of the Sleep command, sleep2 does not detach the RID. However, if the player warps out before the announcement is made the rid also detaches so you could do the following instead.

.@p$ = strcharinfo(0);
// Respawn the Emperium, and display new owners.
sleep 500; // Slow down script execution slightly.
if( agitcheck() )
	donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
sleep 7000;

announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [" + .@p$ + "] from the [" + getguildName(.@GID) + "] guild.",bc_all;

end;

Edited by Jeroen
Posted

i have my code edited

here it is..

will these work just fine??

// Respawn the Emperium, and display new owners.
 set .@breaker$, strcharinfo(0);
 // Respawn the Emperium, and display new owners.
 if (agitcheck()) {
   sleep2 500; // Slow down script execution slightly.
   donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";
   announce "The [" + getcastlename(strnpcinfo(2)) + "] castle has been conquered by [ "+.@breaker$+" ] of the [" + getguildName(.@GID) + "] guild.",bc_all;
   end;
 }

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...