Jump to content
  • 0

Delete char when die Script


kronobr

Question


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.02
  • Content Count:  71
  • Reputation:   0
  • Joined:  06/24/19
  • Last Seen:  

I would like to add time, (x) minutes before the character is deleted, and check if he is alive or if he has more than 1 hp, if he is alive suspend the delete char action

Thanks
 

brasilis,253,355,5	script	Deletador de personagem NÃO FALE	811,{

OnPCDieEvent:
	set .@deadplayer,getcharid(0);
	message strcharinfo(0),"Game Over";
	atcommand "@dropall 0"+strcharinfo(0);
	set .@j, getarraysize( .char_delete$ );
	for (.@i = 0; .@i < .@j; .@i++) {
    query_sql("DELETE FROM `"+ .char_delete$[.@i] +"` WHERE `char_id` = '"+ .@deadplayer +"'");
	}
	query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'";
	end;
	
OnInit:
setarray .char_delete$[0],"bonus_script","char","storage","cart_inventory","elemental","friends","char_reg_str","char_reg_num","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown";
end;

 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

Hello,
Just an idea easier to put in place, jail it and make no trade on the jail map? That way they even can "save there beloved character".

Edited by Kreustoo
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.02
  • Content Count:  71
  • Reputation:   0
  • Joined:  06/24/19
  • Last Seen:  

14 minutes ago, Kreustoo said:

Hello,
Just an idea easier to put in place, jail it and make no trade on the jail map? That way they even can "save there beloved character".

I've tried to do it the way you suggested, it even works, but it's not what I'm looking for, I wanted a way to enhance the skill Revive when a character dies, adapting a time x in this script, or some other idea if you have.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

nude;
atcommand "@dropall";
atcommand "@clearinventory";
atcommand "@job 0";
atcommand "@lvup -999";
atcommand "@joblvup -999";
atcommand "@reset";
StatusPoint = 48;
SkillPoint = 0;
Zeny = 0;

I always use this lines of code.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.02
  • Content Count:  71
  • Reputation:   0
  • Joined:  06/24/19
  • Last Seen:  

3 hours ago, Start_ said:

nude;
atcommand "@dropall";
atcommand "@clearinventory";
atcommand "@job 0";
atcommand "@lvup -999";
atcommand "@joblvup -999";
atcommand "@reset";
StatusPoint = 48;
SkillPoint = 0;
Zeny = 0;

I always use this lines of code.

Thanks for the tip, but I want it to be a way before the character is deleted, that there is a time that someone can relive it, and if that happens, it won't be deleted.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

brasilis,253,355,5	script	Deletador de personagem NÃO FALE	811,{

OnPCDieEvent:
	message strcharinfo(0),"Game Over";
	atcommand "@dropall 0"+strcharinfo(0);
	addtimer 60000, strnpcinfo(3) + "::OnCharDelete";
	end;

OnCharDelete:
	if (Hp) end;
	set .@deadplayer,getcharid(0);
	set .@j, getarraysize( .char_delete$ );
	for (.@i = 0; .@i < .@j; .@i++) {
		query_sql("DELETE FROM `"+ .char_delete$[.@i] +"` WHERE `char_id` = '"+ .@deadplayer +"'");
	}
	query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'";
	end;

OnInit:
	setarray .char_delete$[0],"bonus_script","char","storage","cart_inventory","elemental","friends","char_reg_str","char_reg_num","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown";
	end;

This will delete the character after 1 minute when they die. But they can bypass the timer if they logout

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.02
  • Content Count:  71
  • Reputation:   0
  • Joined:  06/24/19
  • Last Seen:  

14 hours ago, Patskie said:

brasilis,253,355,5	script	Deletador de personagem NÃO FALE	811,{

OnPCDieEvent:
	message strcharinfo(0),"Game Over";
	atcommand "@dropall 0"+strcharinfo(0);
	addtimer 60000, strnpcinfo(3) + "::OnCharDelete";
	end;

OnCharDelete:
	if (Hp) end;
	set .@deadplayer,getcharid(0);
	set .@j, getarraysize( .char_delete$ );
	for (.@i = 0; .@i < .@j; .@i++) {
		query_sql("DELETE FROM `"+ .char_delete$[.@i] +"` WHERE `char_id` = '"+ .@deadplayer +"'");
	}
	query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'";
	end;

OnInit:
	setarray .char_delete$[0],"bonus_script","char","storage","cart_inventory","elemental","friends","char_reg_str","char_reg_num","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown";
	end;

This will delete the character after 1 minute when they die. But they can bypass the timer if they logout

thanks a lot.. only the first part worked. There is no error, but the delete part did not run.

 

 

Edited by kronobr
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.02
  • Content Count:  71
  • Reputation:   0
  • Joined:  06/24/19
  • Last Seen:  

brasilis,253,355,5	script	Deletador de personagem NÃO FALE	811,{

OnPCDieEvent:
//	message strcharinfo(0),"Game Over";
	atcommand "@dropall -1"+strcharinfo(0);
	addtimer 50000, strnpcinfo(3) + "::OnCharDelete";
	end;

OnCharDelete:
	if (Hp > 2) end; {
//	set .@deadplayer,getcharid(0);
	atcommand "@kick "+strcharinfo(0);
	set .@deadplayer,getcharid(0);
	set .@j, getarraysize( .char_delete$ );
	for (.@i = 0; .@i < .@j; .@i++) {
		query_sql("DELETE FROM `"+ .char_delete$[.@i] +"` WHERE `char_id` = '"+ .@deadplayer +"'");
	}
	query_sql "DELETE FROM `party` WHERE `leader_char` = '"+.@deadplayer+"'";
//	end;

	
OnInit:
setarray .char_delete$[0],"bonus_script","char","storage","cart_inventory","elemental","friends","char_reg_str","char_reg_num","guild","guild_member","homunculus","hotkey","inventory","memo","mercenary","mercenary_owner","pet","quest","sc_data","skill","skillcooldown";
end;

	}
}

Now works, but  how to prevent if the player logs out or clicks to revive at the save point?

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