Jump to content
  • 0

sole player reward


cahadeyelo

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

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
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

-	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

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

OnSghGet:
	if ( $sghreward ) end;	// <--- ADD THIS

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   1
  • Joined:  11/13/14
  • Last Seen:  

can't say thank you enough to both of you sir Emistry & Nitrous.

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