Jump to content
  • 0
rom3r

how to delete varibles from offline players

Question

set [email protected], getcharid(3);
set [email protected], query_sql("select account_id from `char` where online = 1", [email protected]);
for(set [email protected],0; [email protected]<[email protected]; set [email protected],[email protected]+1) {
if(attachrid([email protected][[email protected]])){
set Kill, 0;
set Death, 0;
set KillingStreak, 0;
set MultiKill, 0;
set KillingSpree, 0;
set Dominating, 0;
set MegaKill, 0;
set Unstoppable, 0;
set WickedSick, 0;
set MonsterKill, 0;
set Godlike, 0;
set BeyondGodlike, 0;
set DoubleKill, 0;
set TripleKill, 0;
set UltraKill, 0;
set Rampage, 0;
set Ownage, 0;
set NemesisKill, 0;
set FeedCount, 0;
query_sql("TRUNCATE TABLE `pvp_rank`");

This will clear them for online people but nothing ive tried clears the offline people.

Okay i got it working

query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'Kill'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'Death'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'KillingStreak'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'MultiKill'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'KillingSpree'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'Dominating'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'MegaKill'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'Unstoppable'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'WickedSick'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'MonsterKill'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'Godlike'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'BeyondGodlike'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'DoubleKill'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'TripleKill'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'UltraKill'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'Rampage'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'Ownage'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'NemesisKill'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'NemesisKilled'");
query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'FeedCount'");

need that but is there a way to make it neater looking instead of all that?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Try this.

prontera,155,160,4	script	Global Reg Deleter	123,{
set [email protected], getarraysize( .global_delete$ );
while( [email protected] < [email protected] )
{query_sql("DELETE FROM `global_reg_value` WHERE `str` = '"+ .global_delete$[[email protected]] +"'"); set [email protected],[email protected]+1;}
end;
OnInit:
setarray .global_delete$[0],"Kill","Death","KillingStreak","MultiKill","KillingSpree","Dominating","MegaKill","Unstoppable","WickedSick","MonsterKill","Godlike","BeyondGodlike","DoubleKill","TripleKill","UltraKill","NemesisKill","NemesisKilled","FeedCount";
end;
}
  • Upvote 2
Link to comment
Share on other sites

or you can use @var instead of var, this is a temporary variable, that means, once the player logs off it automatically gets deleted, for example:

 

set @Kill, @Kill + 1;
set @Death, @Death + 1;
Link to comment
Share on other sites

+1

 

if you want to rely on your current script, I think you can also change this line

select account_id from `char` where online = 1

to

select account_id from `char` where online = 1 OR online = 0
Edited by shadowscreen
  • Upvote 1
Link to comment
Share on other sites

 

+1

 

if you want to rely on your current script, I think you can also change this line

select account_id from `char` where online = 1

to

select account_id from `char` where online = 1 OR online = 0

I tried that it still wouldnt delete the offline

Link to comment
Share on other sites

 

Try this.

prontera,155,160,4	script	Global Reg Deleter	123,{
set [email protected], getarraysize( .global_delete$ );
while( [email protected] < [email protected] )
{query_sql("DELETE FROM `global_reg_value` WHERE `str` = '"+ .global_delete$[[email protected]] +"'"); set [email protected],[email protected]+1;}
end;
OnInit:
setarray .global_delete$[0],"Kill","Death","KillingStreak","MultiKill","KillingSpree","Dominating","MegaKill","Unstoppable","WickedSick","MonsterKill","Godlike","BeyondGodlike","DoubleKill","TripleKill","UltraKill","NemesisKill","NemesisKilled","FeedCount";
end;
}

thank you looks so much neater

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.