Jump to content
  • 0

need script for send prize to all player


Hossam

Question


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

need script ---  send prize to all player

and how i can add script on ragnahosting 

 

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

4 hours ago, Hossam said:

need script ---  send prize to all player

and how i can add script on ragnahosting 

 

//credits to emistry
// usage :
// [npc:Sample]map#512#10
// [npc:Sample]all#512#123


-	script	Sample	-1,{
OnWhisperGlobal:
if( getgmlevel() >= 99 ){
	// check map
	if( @whispervar0$ == "all" ) set .@type$,"";
	else if( @whispervar0$ == "map" ) set .@type$,strcharinfo(3);
	else {
		dispbottom "Error, pick 'map' or 'all' ";
		end;
	}
	
	// check item
	set .@itemid,atoi( @whispervar1$ );
	set .@amount,atoi( @whispervar2$ );
	if( getitemname( .@itemid ) == "null" || .@amount < 1 ){
		dispbottom "Enter valid item id and amount.";
	}
	
	set .@self_id,getcharid(3);
	query_sql( "SELECT COUNT(`account_id`) FROM `char` WHERE `online` = 1 ", .@total );
	while( .@count < .@total ){
		query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY `account_id` LIMIT 128 OFFSET "+.@offset, .@aid,.@name$ );
		set .@i,0;
		set .@size,getarraysize( .@aid );
		while( .@i < .@size ){
			if( .@aid[.@i] != .@self_id ){
				if( .@type$ != "" ){
					getmapxy( .@map$,.@x,.@y,0,.@name$[.@i] );
					if( .@map$ == .@type$ ){
						getitem .@itemid,.@amount,.@aid[.@i];
						set .@gave,.@gave + 1;
					}
				}else{
					getitem .@itemid,.@amount,.@aid[.@i];
					set .@gave,.@gave + 1;
				}
			}
			set .@count,.@count + 1;
			set .@i,.@i + 1;
		}
		set .@offset,.@offset + .@size;
		deletearray .@aid,.@size;
		deletearray .@name$,.@size;
	}
	dispbottom "Gave "+.@amount+" x "+getitemname( .@itemid )+" to "+.@gave+" Player(s).";
}
end;
}

to add this npc to you server download wincp
login using your server details and add this file to your custom folder (or what ever folder you using)
 and also add your npc path in  scripts_custom.conf  
then do reloadscript/restart server/loadnpc

Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

14 minutes ago, Hossam said:

up 
need script send reward to all players online

all map but how can work ? 
or command for send to all player ?

// [npc:Sample]map#512#10
// [npc:Sample]all#512#123
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

Go to your client area at Ragnahosting, check your messages there, and there should be one that says "Your Cloud Instance Has Been Deployed." That has all the information you need to add the script to your server, use FileZilla or any other FTP program to upload your scripts to rAthena/npc/custom/

Then go back to rAthena/npc/ and edit scripts_custom.conf.

  • Upvote 1
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:  

20 hours ago, kyithios said:

Go to your client area at Ragnahosting, check your messages there, and there should be one that says "Your Cloud Instance Has Been Deployed." That has all the information you need to add the script to your server, use FileZilla or any other FTP program to upload your scripts to rAthena/npc/custom/

Then go back to rAthena/npc/ and edit scripts_custom.conf.

i get error 

Response:    ‎‪331 User  OK. Password required
Command:    ‎‪PASS ****************
Response:    ‎‪530 Login authentication failed
Error:    Critical error: Could not connect to server
 

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:  

18 hours ago, Cyro said:

//credits to emistry
// usage :
// [npc:Sample]map#512#10
// [npc:Sample]all#512#123


-	script	Sample	-1,{
OnWhisperGlobal:
if( getgmlevel() >= 99 ){
	// check map
	if( @whispervar0$ == "all" ) set .@type$,"";
	else if( @whispervar0$ == "map" ) set .@type$,strcharinfo(3);
	else {
		dispbottom "Error, pick 'map' or 'all' ";
		end;
	}
	
	// check item
	set .@itemid,atoi( @whispervar1$ );
	set .@amount,atoi( @whispervar2$ );
	if( getitemname( .@itemid ) == "null" || .@amount < 1 ){
		dispbottom "Enter valid item id and amount.";
	}
	
	set .@self_id,getcharid(3);
	query_sql( "SELECT COUNT(`account_id`) FROM `char` WHERE `online` = 1 ", .@total );
	while( .@count < .@total ){
		query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY `account_id` LIMIT 128 OFFSET "+.@offset, .@aid,.@name$ );
		set .@i,0;
		set .@size,getarraysize( .@aid );
		while( .@i < .@size ){
			if( .@aid[.@i] != .@self_id ){
				if( .@type$ != "" ){
					getmapxy( .@map$,.@x,.@y,0,.@name$[.@i] );
					if( .@map$ == .@type$ ){
						getitem .@itemid,.@amount,.@aid[.@i];
						set .@gave,.@gave + 1;
					}
				}else{
					getitem .@itemid,.@amount,.@aid[.@i];
					set .@gave,.@gave + 1;
				}
			}
			set .@count,.@count + 1;
			set .@i,.@i + 1;
		}
		set .@offset,.@offset + .@size;
		deletearray .@aid,.@size;
		deletearray .@name$,.@size;
	}
	dispbottom "Gave "+.@amount+" x "+getitemname( .@itemid )+" to "+.@gave+" Player(s).";
}
end;
}

to add this npc to you server download wincp
login using your server details and add this file to your custom folder (or what ever folder you using)
 and also add your npc path in  scripts_custom.conf  
then do reloadscript/restart server/loadnpc

script not work why ??
i used in go 16 but get error

 

0.jpg

Edited by Hossam
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

1 minute ago, Hossam said:

i get error 

Response:    ‎‪331 User  OK. Password required
Command:    ‎‪PASS ****************
Response:    ‎‪530 Login authentication failed
Error:    Critical error: Could not connect to server
 

In FileZilla (which I use to upload scripts and download server stuff to edit)...

Host IP: (Whatever your host IP is according to the mail in your client area)
SFTP - SSH File Transfer Protocol
ALWAYS USE PORT 22
Enter the username and password you were given.

If it still doesn't work, you're gonna have to go through their support. Which has been inactive for three days. Good luck.

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:  

22 minutes ago, kyithios said:

In FileZilla (which I use to upload scripts and download server stuff to edit)...

Host IP: (Whatever your host IP is according to the mail in your client area)
SFTP - SSH File Transfer Protocol
ALWAYS USE PORT 22
Enter the username and password you were given.

If it still doesn't work, you're gonna have to go through their support. Which has been inactive for three days. Good luck.

 

0.jpg

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

You're gonna have to get ahold of Ragnahosting. I don't have your information, I'm not staff for them, so I don't know what you're doing wrong.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

On 08/02/2017 at 4:02 AM, Hossam said:

 

0.jpg

You must not use FTP like file Zilla .. u must use wincp which is sftp 

 

 

The script I gave you working fyn!

The error says I must give prize to all or only the map??

 

Edited by Cyro
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

On 07/02/2017 at 6:56 AM, kyithios said:

Go to your client area at Ragnahosting, check your messages there, and there should be one that says "Your Cloud Instance Has Been Deployed." That has all the information you need to add the script to your server, use FileZilla or any other FTP program to upload your scripts to rAthena/npc/custom/

Then go back to rAthena/npc/ and edit scripts_custom.conf.

FTP client for webhost dude... Don't misslead new people

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

12 hours ago, Cyro said:

FTP client for webhost dude... Don't misslead new people

That's why I said "SFTP"... I use FileZilla. 

 

17 hours ago, kyithios said:

In FileZilla (which I use to upload scripts and download server stuff to edit)...

Host IP: (Whatever your host IP is according to the mail in your client area)
SFTP - SSH File Transfer Protocol
ALWAYS USE PORT 22
Enter the username and password you were given.

If it still doesn't work, you're gonna have to go through their support. Which has been inactive for three days. Good luck.

^ See? I mislead nobody. Almost every single FTP client has the power to use SFTP, you just have to select the right option.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

14 minutes ago, kyithios said:

That's why I said "SFTP"... I use FileZilla. 

 

^ See? I mislead nobody. Almost every single FTP client has the power to use SFTP, you just have to select the right option.

No offence... He got Miss leaded filezilla set to the port FTP not sftp which new people may not know... Even wincp got FTP profile

Hope u get my point ,:)

  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

1 minute ago, Cyro said:

No offence... He got Miss leaded filezilla set to the port FTP not sftp which new people may not know... Even wincp got FTP profile

Hope u get my point ,:)

No offense taken, I just figured I should point out where I corrected myself after, because it is a bit misleading. I should edit it, but I'm not sure if I should.

  • Upvote 2
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:  

up 
need script send reward to all players online

On 2/8/2017 at 5:25 AM, Cyro said:

You must not use FTP like file Zilla .. u must use wincp which is sftp 

 

 

The script I gave you working fyn!

The error says I must give prize to all or only the map??

 

all map but how can work ? 
or command for send to all player ?

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 2/10/2017 at 10:19 AM, Cyro said:

// [npc:Sample]map#512#10
// [npc:Sample]all#512#123

remove // ?

 

thnakssssssssssssssssss Cyro 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

nope bro
thats how you need to use it, whisper  your npc like npc:sample and if you want to give all online player user all itemid quantity, or  all#itemid#quantity

  • Upvote 1
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...