Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-08-2012, 01:27 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Summon in playerlist

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);
  }

Attached Images
 
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion

Last edited by Gunderak; 01-08-2012 at 02:33 PM..
Reply With Quote
  #2  
Old 01-08-2012, 01:33 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
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) { 
__________________
Reply With Quote
  #3  
Old 01-08-2012, 02:25 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by Emera View Post
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
__________________
MEEP!
Reply With Quote
  #4  
Old 01-08-2012, 02:33 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
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.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #5  
Old 01-08-2012, 02:44 PM
iBeatz iBeatz is offline
Kavan
iBeatz's Avatar
Join Date: Dec 2010
Location: Northern Ireland, UK
Posts: 154
iBeatz will become famous soon enough
Send a message via Yahoo to iBeatz
Quote:
Originally Posted by callimuc View Post
PHP Code:
if (graalversion => 6.015) { 
PHP Code:
if (graalversion >= 6.015) { 
__________________

Intelligence without ambition is like a bird without wings.

Reply With Quote
  #6  
Old 01-08-2012, 02:52 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Lol...
There is so many ways of achieving such a small task..
Thanks for boggling my mind.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #7  
Old 01-08-2012, 03:02 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by iBeatz View Post
PHP Code:
if (graalversion >= 6.015) { 
It´s the same :o
__________________
MEEP!
Reply With Quote
  #8  
Old 01-08-2012, 03:02 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Sorry about the < sign. I was thinking of something else at the same time xD.
__________________
Reply With Quote
  #9  
Old 01-19-2012, 08:00 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Emera View Post
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.
Reply With Quote
  #10  
Old 01-20-2012, 02:31 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Gunderak View Post
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.
__________________
Skyld
Reply With Quote
  #11  
Old 01-20-2012, 04:27 AM
papajchris papajchris is offline
Zeus Condero
papajchris's Avatar
Join Date: Jan 2006
Location: Michigan
Posts: 1,600
papajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to behold
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!
Reply With Quote
  #12  
Old 01-20-2012, 05:48 AM
maximus_asinus maximus_asinus is offline
RIP DarkCloud_PK
Join Date: Oct 2001
Location: Canada
Posts: 3,745
maximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond repute
This thread has shown me that you can manipulate the playerlist, something I wasn't aware of. I think that is a success.
__________________
Save Classic!
Reply With Quote
  #13  
Old 01-20-2012, 08:09 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
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..
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #14  
Old 01-20-2012, 06:00 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by papajchris View Post
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.
__________________
MEEP!
Reply With Quote
  #15  
Old 01-20-2012, 06:18 PM
papajchris papajchris is offline
Zeus Condero
papajchris's Avatar
Join Date: Jan 2006
Location: Michigan
Posts: 1,600
papajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to beholdpapajchris is a splendid one to behold
Quote:
Originally Posted by callimuc View Post
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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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