Jump to content
  • 0

set dar_dar,1;


Question

Posted

example is set dar_dar,1

how can I reset the set of the player?

For example he can do the quest again.

Example of script.

Finish quest = set dar_dar,1;

if dar_dar,1; - cannot do that quest again.

but how can I reset a player or GM set so it can do that quest again?

thanks in advance

3 answers to this question

Recommended Posts

Posted

I think you could create a command like @reset_dar that uses

pc_setaccountreg(sd, "dar_dar", 0);

then to use it on other players: #reset_dar PlayerName.

If you don't want to edit the source, you could make a script that GMs can whisper the name of a player, then the script resets the player's variable.

-	script	reset_dar	-1,{
OnWhisperGlobal:
if (getgroupid() < 99) end;
set .@AID, playerattached();
set .@name$, @whispervar0$;

mes "[dar_dar reset]";
mes "Do you want to reset the Dar Dar quest for " + .@name$ + "?";
if (select("Yes:No")==2) close;

// check if player exists
if (query_sql "SELECT char_id,account_id FROM `char` WHERE `name`='"+escape_sql(.@name$)+"'", .@char_id, .@account_id) {
	// if player is online ...
	if (isloggedin(.@char_id, .@account_id)) {
		if (attachrid .@account_id) {
			set dar_dar, 0;
			attachrid .@AID;
			mes "Dar Dar quest reset for " + .@name$ + ".";
		}
	} else {
		// offline - delete variable from SQL
		query_sql "DELETE FROM global_reg_value WHERE char_id="+.@char_id+" AND `str`='dar_dar'";
		mes "Dar Dar quest reset for " + .@name$ + ".";
	}
} else {
	mes "Player not found.";
}
close;
}

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