Jump to content
  • 0

sole player reward


Question

Posted (edited)

how can i fix this script that it'll only give the item #30004 to the first player that completed his/her 3 minutes of staying ingame after my server launching.

-	script	SGH_POINTS	-1,{

OnPCLoginEvent:
	addtimer 60000,"SGH_POINTS::OnSghGet";
	end;
    
OnSghGet:
	getmapxy( .@new$, .@x, .@y, 0 );
	if( .@new$ == "new_1-1" ) {
	set SGH_MINUTE_P, SGH_MINUTE_P + 1;
	dispbottom "Gained : 1 Point(s). Total : "+SGH_MINUTE_P+" Minute(s).";
	}
	if ( SGH_MINUTE_P == 3 ){
	getitem 30004,1;
	$sghreward = 1;
	end;
	}
	addtimer 60000,"SGH_POINTS::OnSghGet";
	end;

OnInit:
	if ($sghreward = 1) end;
}

 

Edited by cahadeyelo

3 answers to this question

Recommended Posts

  • 0
Posted
-	script	SGH_POINTS	-1,{

OnPCLoginEvent:
	if ($sghreward) end;
	addtimer 60000,"SGH_POINTS::OnSghGet";
	end;
    
OnSghGet:
	if ($sghreward) end;
	getmapxy( .@new$, .@x, .@y, 0 );
	if( .@new$ == "new_1-1" ) {
	set SGH_MINUTE_P, SGH_MINUTE_P + 1;
	dispbottom "Gained : 1 Point(s). Total : "+SGH_MINUTE_P+" Minute(s).";
	}
	if ( SGH_MINUTE_P == 3 ){
	getitem 30004,1;
	$sghreward = 1;
	end;
	}
	addtimer 60000,"SGH_POINTS::OnSghGet";
	end;
}

dont need the OnInit label

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