Jump to content
  • 0

Help hourgift script


Hossam

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  09/06/15
  • Last Seen:  

-	script	hourly_reward_main	-1,{
	
	OnInit:
		setarray .itemid,6379,522,12412,604,12221,16774,12103,12710,14296,14601,7929,12202,12203,12204,12205,12206,12207,7959;
		setarray .amount,10,100,1,10,1,2,2,3,2,5,2,2,2,2,2,2,2,2;

		.itemid_size = getarraysize( .itemid );
		end;
		
	OnMinute00:
		query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY RAND() LIMIT 1",.@aid,.@name$ );
		if ( .@aid ) {
			.@i = rand( .itemid_size );
			getitem .itemid[.@i],.amount[.@i],.@aid;
			announce "Krizazone Server - Lucky Player ["+.@name$+"] has receive ["+.amount[.@i]+"x "+getitemname( .itemid[.@i] )+"]!!",bc_all;
		}
		end;
}

i need help here
this script send to all player online and all marchents autotrade
i want make it to send to all player online not marchents autotrade
any help ?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1678
  • Reputation:   704
  • Joined:  12/21/14
  • Last Seen:  

since you are using sql to get the player name

you can get the vinding too from sql in vendings table

check if the player id = vinding

if not = give him the items

if it's = search for another player

it would be hard a little

 

however

there is this command >>

if(checkvending() == 0) {//not vinding}

if(checkvending() ==1){//vinding}

 

i would suggest seen this if you want to change your script

 

 

 

Edited by sader1992
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   55
  • Joined:  12/02/11
  • Last Seen:  

1 hour ago, Hossam said:

-	script	hourly_reward_main	-1,{
	
	OnInit:
		setarray .itemid,6379,522,12412,604,12221,16774,12103,12710,14296,14601,7929,12202,12203,12204,12205,12206,12207,7959;
		setarray .amount,10,100,1,10,1,2,2,3,2,5,2,2,2,2,2,2,2,2;

		.itemid_size = getarraysize( .itemid );
		end;
		
	OnMinute00:
		query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY RAND() LIMIT 1",.@aid,.@name$ );
		if ( .@aid ) {
			.@i = rand( .itemid_size );
			getitem .itemid[.@i],.amount[.@i],.@aid;
			announce "Krizazone Server - Lucky Player ["+.@name$+"] has receive ["+.amount[.@i]+"x "+getitemname( .itemid[.@i] )+"]!!",bc_all;
		}
		end;
}

i need help here
this script send to all player online and all marchents autotrade
i want make it to send to all player online not marchents autotrade
any help ?

Hi please try this I'm not on my PC.

-	script	hourly_reward_main	-1,{
OnInit:
	setarray .itemid,6379,522,12412,604,12221,16774,12103,12710,14296,14601,7929,12202,12203,12204,12205,12206,12207,7959;
	setarray .amount,10,100,1,10,1,2,2,3,2,5,2,2,2,2,2,2,2,2;
	.itemid_size = getarraysize( .itemid );
	end;
		
OnMinute00:
	.@size = query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY RAND() LIMIT 1",.@aid,.@name$ );
	for( .@i = 0; .@i < .@size; .@i++ ) {
		if( checkvending( .@name$[.@i] ) || checkchatting( .@name$[.@i] ) ) end;
	else if( .@aid )
		.@i = rand( .itemid_size );
		getitem .itemid[.@i],.amount[.@i],.@aid;
		announce "Krizazone Server - Lucky Player ["+.@name$+"] has received "+.amount[.@i]+" x "+getitemname( .itemid[.@i] )+".",0;
	}
	end;
}

Let me know if it's working.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  09/06/15
  • Last Seen:  

15 hours ago, Kaze said:

Hi please try this I'm not on my PC.


-	script	hourly_reward_main	-1,{
OnInit:
	setarray .itemid,6379,522,12412,604,12221,16774,12103,12710,14296,14601,7929,12202,12203,12204,12205,12206,12207,7959;
	setarray .amount,10,100,1,10,1,2,2,3,2,5,2,2,2,2,2,2,2,2;
	.itemid_size = getarraysize( .itemid );
	end;
		
OnMinute00:
	.@size = query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY RAND() LIMIT 1",.@aid,.@name$ );
	for( .@i = 0; .@i < .@size; .@i++ ) {
		if( checkvending( .@name$[.@i] ) || checkchatting( .@name$[.@i] ) ) end;
	else if( .@aid )
		.@i = rand( .itemid_size );
		getitem .itemid[.@i],.amount[.@i],.@aid;
		announce "Krizazone Server - Lucky Player ["+.@name$+"] has received "+.amount[.@i]+" x "+getitemname( .itemid[.@i] )+".",0;
	}
	end;
}

Let me know if it's working.

Thank you
I will try it and I will tell you if it workThank you I will try it and I will tell you if it workss

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  09/06/15
  • Last Seen:  

On 6/30/2017 at 4:20 PM, Kaze said:

Hi please try this I'm not on my PC.


-	script	hourly_reward_main	-1,{
OnInit:
	setarray .itemid,6379,522,12412,604,12221,16774,12103,12710,14296,14601,7929,12202,12203,12204,12205,12206,12207,7959;
	setarray .amount,10,100,1,10,1,2,2,3,2,5,2,2,2,2,2,2,2,2;
	.itemid_size = getarraysize( .itemid );
	end;
		
OnMinute00:
	.@size = query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY RAND() LIMIT 1",.@aid,.@name$ );
	for( .@i = 0; .@i < .@size; .@i++ ) {
		if( checkvending( .@name$[.@i] ) || checkchatting( .@name$[.@i] ) ) end;
	else if( .@aid )
		.@i = rand( .itemid_size );
		getitem .itemid[.@i],.amount[.@i],.@aid;
		announce "Krizazone Server - Lucky Player ["+.@name$+"] has received "+.amount[.@i]+" x "+getitemname( .itemid[.@i] )+".",0;
	}
	end;
}

Let me know if it's working.

not work

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