View Single Post
  #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