View Single Post
  #1  
Old 07-10-2011, 04:34 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Once Again X_X Jail Script

I know the forum ruless, and yes i know im NOT meant to ask for help above my scripting level but i finally have this script working so you double click a player and it has "jail" "unjail" and "warn". could someone please add somehing so i can have time function so theres like a text bit with where you put the time :3?
thanks in advanced
-Gunderak

PHP Code:
function onActionServerSide() {
if (
params[0] == "jail") {
 
findplayerbycommunityname(params[1]).setlevel2("jail.nw", 31.5, 28.5).addweapon ("-Jail");;
}
if (
params[0] == "unjail") {
findplayerbycommunityname(params[1]).setlevel2("ge_f2.nw", 0, 24);
}
if (
params[0] == "warn") {
findplayerbycommunityname(params[1]).setlevel2("warning_room.nw", 37.5, 16.5);
}
}

//Scripted By Gunderak
//#CLIENTSIDE
function onCreated() {
  new 
GuiTextCtrl("MyGUI_TextEdit1") { 
    
profile = GuiBlueTextProfile;
    
x = 81;
    
y = 5;
    
height = 20;
    
text = "";
  }
}
function 
onMouseDown(mode) {
  if (
mode == "double") {
    for (
pl: players) {
      if ( 
mousex in | pl.x + 0.5, pl.x + 2.5| && mousey in | pl.y, pl.y + 3|) { 
        if (
pl != NULL) {
           new 
GuiWindowCtrl("MyGUI_Window1") {
    
profile = GuiBlueWindowProfile;
    
clientrelative = true;
    
clientextent = "85,126";

    
canmaximize = false;
    
canminimize = false;
    
canmove = true;
    
canresize = true;
    
closequery = false;
    
destroyonhide = true;
    
text = "Staff";
    
y = 96;

    new 
GuiButtonCtrl("MyGUI_Button1") {
      
profile = GuiBlueButtonProfile;
      
text = "Jail";
      
width = 85;
    }
    new 
GuiButtonCtrl("MyGUI_Button2") {
      
profile = GuiBlueButtonProfile;
      
text = "UnJail";
      
width = 85;
      
y = 29;
    }
    new 
GuiButtonCtrl("MyGUI_Button3") {
      
profile = GuiBlueButtonProfile;
      
text = "Warn";
      
width = 85;
      
y = 58;
    }
    new 
GuiTextEditCtrl("MyGUI_TextEdit1") {
      
profile = GuiBlueTextEditProfile;
      
height = 20;
      
width = 85;
      
x = 0;
      
y = 106;
      
MyGUI_TextEdit1.text = pl.account;
    }
      new 
GuiTextEditCtrl("MyGUI_TextEdit2") {
      
profile = GuiBlueTextEditProfile;
      
height = 20;
      
width = 85;
      
x = 0;
      
y = 88;
      
MyGUI_TextEdit2.text = pl.nick;
    }
  }
}
}
function 
MyGUI_Button1.onAction() {
triggerserver("gui",this.name,"jail",MyGUI_TextEdit1.text);
player.addweapon(-Jailed);
}

function 
MyGUI_Button2.onAction() {
triggerserver("gui",this.name,"unjail",MyGUI_TextEdit1.text);
}

function 
MyGUI_Button3.onAction() {
triggerserver("gui",this.name,"warn",MyGUI_TextEdit1.text);
}
        }
      }
    } 
__________________

Gund for president.

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