Jump to content
  • 0

Daily Raffle Reward help


LordJasz

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  05/21/18
  • Last Seen:  

Hello rAthenees. ?
could someone help me creating a NPC that makes a Raffle Everyday?

This is the very beggining of the script with the main idea.

	query_sql("select `value` from acc_reg_num where `key` = '#evento' order by `value` desc limit 1",.@winner);

	mes "Hello! Do you want to entry or receive your reward?";
	next;
	menu "Yes",SIM,"No",NAO,"Reward",Recompensa; 
	SIM: if(#evento<1){
		set #evento, rand(1,10000);
		mes "Done. Your Number is "+#evento+".";
		mes "Good Luck!";
		}
		else{
		mes "You're already participating. Your number is "+#evento+".";
		mes "Good Luck!";
		}
		close;
		end;
	NAO: mes "Okay! ^^";
		close;
		end;
	Recompensa:
		if (#winner = 1){
		mes "C O N G R A T U L A T I O N S!"
		getitem 607, 10;
		set #winner,0;
		}
		else{
		mes "Sorry, you're not the winner.";
		mes "Good luck next time!";
        }
		close;
		end;
OnClock1915:
	set #winner,1; // how can i set the winner here where #evento == .@winner?
	query_sql("UPDATE `acc_reg_num` SET `value` = '0' WHERE `key` ='#evento'");

Im stuck on how im gonna make it reset every day to make a new winner.
someone could shine my mind?
Thx ❤️

Edited by LordJasz
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  296
  • Reputation:   4
  • Joined:  02/19/17
  • Last Seen:  

On 8/14/2018 at 10:44 AM, LordJasz said:

Hello rAthenees. ?
could someone help me creating a NPC that makes a Raffle Everyday?

This is the very beggining of the script with the main idea.


	query_sql("select `value` from acc_reg_num where `key` = '#evento' order by `value` desc limit 1",.@winner);

	mes "Hello! Do you want to entry or receive your reward?";
	next;
	menu "Yes",SIM,"No",NAO,"Reward",Recompensa; 
	SIM: if(#evento<1){
		set #evento, rand(1,10000);
		mes "Done. Your Number is "+#evento+".";
		mes "Good Luck!";
		}
		else{
		mes "You're already participating. Your number is "+#evento+".";
		mes "Good Luck!";
		}
		close;
		end;
	NAO: mes "Okay! ^^";
		close;
		end;
	Recompensa:
		if (#winner = 1){
		mes "C O N G R A T U L A T I O N S!"
		getitem 607, 10;
		set #winner,0;
		}
		else{
		mes "Sorry, you're not the winner.";
		mes "Good luck next time!";
        }
		close;
		end;
OnClock1915:
	set #winner,1; // how can i set the winner here where #evento == .@winner?
	query_sql("UPDATE `acc_reg_num` SET `value` = '0' WHERE `key` ='#evento'");

Im stuck on how im gonna make it reset every day to make a new winner.
someone could shine my mind?
Thx ❤️

did you already fix this?

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