Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Summon in playerlist (https://forums.graalonline.com/forums/showthread.php?t=134265537)

Gunderak 01-08-2012 01:27 PM

Summon in playerlist
 
1 Attachment(s)
Well I have always been annoyed how there was a warpto and no summon, So I decided to make my own.
This script will put Summon directly underneath warpto.
It also removes a divider which I feel is unnecessary anyway.
-Enjoy
PHP Code:


function onActionServerSide() {
  if (
params[0] == "summon" && player.hasrightflag("warptoxy")) {
    
//Checks if the player is summoning and has the right to.
    
for (temp.pallplayers) {
      if (
p.nick == params[1]) {
        
temp.plyr p;
      }
    }
    
//May summon wrong player if two people have the same name
    //this happens as their account is not stored in the list of players, just their name.
    
plyr.setlevel2(player.levelplayer.xplayer.y);
    
//Warps the player.
  
} else {
    
player.chat "You don't have sufficent rights!";
    
//If they don't have the rights to summon.
  
}
}

//#CLIENTSIDE
function onFirstResponderChanges(obj) {
  if (
obj.name == "PlayerList_Menu") {
    if (!
graalversion6) {
      
//It is known to not add to the list properly when using V5.
      
with(PlayerList_Menu) {
        
insertrow(411"Summon (Staff)");
        
//Adds the summon row to the list.
        
width 133;
        
removerow(8);
        
//Removes the unneeded divider.
      
}
    }
  }
}

function 
PlayerList_Menu.onSelect() {
  if (
params[1] == "Summon (Staff)") {
    
//If you click on summon
    
temp.plyr PlayerList_List.getselectedtext();
    
triggerserver("weapon"this.name"summon"plyr);
  }



Emera 01-08-2012 01:33 PM

What's wrong with a chat command? Why do you even need a summon. Just warp to the player in question. It's just another toy that screams "Abuse me". Also, adding a row to a GUI control is pretty simple stuff and doesn't require a genuis to code it. Why post something like this?

and for this...
PHP Code:

if (graalversion == 6.015 || graalversion 6.015) { 

It can be shortened down to...
PHP Code:

if (graalversion 6) { 


callimuc 01-08-2012 02:25 PM

Quote:

Originally Posted by Emera (Post 1681256)
What's wrong with a chat command? Why do you even need a summon. Just warp to the player in question. It's just another toy that screams "Abuse me". Also, adding a row to a GUI control is pretty simple stuff and doesn't require a genuis to code it. Why post something like this?

and for this...
PHP Code:

if (graalversion == 6.015 || graalversion 6.015) { 

It can be shortened down to...
PHP Code:

if (graalversion 6) { 


PHP Code:

if (graalversion => 6.015) { 

thats what he wants :P Also you can use the warp thing as a command... I like this and now I know how to add stuff into the playerslist window :o should check the GUI container more.

But it seems very nice the script.

PS: Maybe you should change the right to warpplayers seems more to be the one you need :P

Gunderak 01-08-2012 02:33 PM

Regarding if (graalversion < 6) { I didn't even think of doing that lol..
I'll add it in now.
Quote:

Originally Posted by Emera
Also, adding a row to a GUI control is pretty simple stuff and doesn't require a genuis to code it.

Correct, but manipulating the positioning of rows in V5 is buggy.
insertrow doesn't insert it in V5, instead of squeezing it in, it replaces the already existing row.

iBeatz 01-08-2012 02:44 PM

Quote:

Originally Posted by callimuc (Post 1681257)
PHP Code:

if (graalversion => 6.015) { 


PHP Code:

if (graalversion >= 6.015) { 

;)

Gunderak 01-08-2012 02:52 PM

Lol...
There is so many ways of achieving such a small task..
Thanks for boggling my mind.

callimuc 01-08-2012 03:02 PM

Quote:

Originally Posted by iBeatz (Post 1681259)
PHP Code:

if (graalversion >= 6.015) { 

;)

Itīs the same :o

Emera 01-08-2012 03:02 PM

Sorry about the < sign. I was thinking of something else at the same time xD.

scriptless 01-19-2012 08:00 PM

Quote:

Originally Posted by Emera (Post 1681256)
What's wrong with a chat command? Why do you even need a summon. Just warp to the player in question. It's just another toy that screams "Abuse me". Also, adding a row to a GUI control is pretty simple stuff and doesn't require a genuis to code it. Why post something like this?

and for this...
PHP Code:

if (graalversion == 6.015 || graalversion 6.015) { 

It can be shortened down to...
PHP Code:

if (graalversion 6) { 


Sometimes, you cant tell if the players name has an 1,l,L,i,I so this system would make that confusion less.. I like this script o_o.

Also, in some cases you may been to summon a player. It's not just an "abuse only" tool.. it has some serious applicability to many servers. something is broken and a staff has to summon a player for example.

Skyld 01-20-2012 02:31 AM

Quote:

Originally Posted by Gunderak (Post 1681255)
Well I have always been annoyed how there was a warpto and no summon, So I decided to make my own.
This script will put Summon directly underneath warpto.
It also removes a divider which I feel is unnecessary anyway.
-Enjoy

This will break if ever we make any changes to the playerlist script. There is findweapon("-Playerlist").addCustomMenuEntry(index, name); built into the playerlist (there's no specific callback method right now but you can probably define function PlayerList_Menu.onSelect(index, name) in your script to capture those clicks) which would probably be better for you to use.

papajchris 01-20-2012 04:27 AM

Good Job. I agree with Gunderak. It was always quite annoying.

@Emera, this is useful for those accounts that still have Graal#### as their Community name. I would have to always memorize the #'s and quickly switch to chat bar and hope I didn't forget!

maximus_asinus 01-20-2012 05:48 AM

This thread has shown me that you can manipulate the playerlist, something I wasn't aware of. I think that is a success.

Gunderak 01-20-2012 08:09 AM

Good to see that I am getting people thinking of new idea's.
Or as it is more commonly known as "broadening the horizon".
@Skyld, is there any way of getting the account from the row? my method of summoning doesn't work if two people have the same name..

callimuc 01-20-2012 06:00 PM

Quote:

Originally Posted by papajchris (Post 1682186)
Good Job. I agree with Gunderak. It was always quite annoying.

@Emera, this is useful for those accounts that still have Graal#### as their Community name. I would have to always memorize the #'s and quickly switch to chat bar and hope I didn't forget!

I simply opened up a pm window to them and typed the account name while having the PM window opened.

papajchris 01-20-2012 06:18 PM

Quote:

Originally Posted by callimuc (Post 1682207)
I simply opened up a pm window to them and typed the account name while having the PM window opened.

Try doing that for a spar tournament or something. it gets old reallly fast


All times are GMT +2. The time now is 04:08 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.