Quote:
Originally Posted by Twinny
Going to share or just state? 
|
sure why not.
Here's the weapon
PHP Code:
function onActionServerside()
{
if (params[0]=="summon")
{
player.chat = "Summoning!";
with(findplayer(@params[1])) {
setlevel2(params[2],params[3],params[4]);
player.chat = "Summoned";
}
player.chat = "Summoned: " @params[1];
}
if(params[0] == "placeblock")
{
putnpc2(params[1], params[2], "join staffblock;");
temp.placcount = player.account;
with(npcs[npcs.size()-1]) {
this.owner = temp.placcount;
}
}
if(params[0] == "placeblock1")
{
putnpc2(params[1], params[2], "join alertblock;");
temp.placcount = player.account;
with(npcs[npcs.size()-1]) {
this.owner = temp.placcount;
}
}
if(params[0] == "placeblock2")
{
putnpc2(params[1], params[2], "join buildblock;");
temp.placcount = player.account;
with(npcs[npcs.size()-1]) {
this.owner = temp.placcount;
}
}
switch(params[0])
{
case "setnick":
player.nick = params[1];
break;
}
}
//#CLIENTSIDE
function onCreated() {
initSTWind();
Staff_Powers_Main.visible = false;
onTimeOut();
}
function onKeyPressed() {
if (params[0]=="49")
{
Staff_Powers_Main.visible != Staff_Powers_Main.visible;
}
}
function initSTWind() {
new GuiWindowCtrl(Staff_Powers_Main) {
useownprofile = true;
profile = "GuiBlueWindowProfile";
canclose = false;
canmove = true;
canresize = false;
extent = {200, 250};
canminimize = true;
canmaximize = false;
x = screenwidth-200;
y = 0;
title = true;
text = "Staff Control";
profile.fontSize = 14;
profile.fontColor = "255 255 255";
new GuiButtonCtrl(Staff_Powers_Close){
profile = "GuiBlueButtonProfile";
text = "Close";
extent = "35 16";
position = "7 227";
};
new GuiButtonCtrl(Staff_Powers_Block){
profile = "GuiBlueButtonProfile";
text = "Norm";
extent = "32 32";
position = "7 25";
};
new GuiButtonCtrl(Staff_Powers_Alert_Block){
profile = "GuiBlueButtonProfile";
text = "Alert";
extent = "32 32";
position = "41 25";
};
new GuiButtonCtrl(Staff_Powers_Build_Block) {
profile = "GuiBlueButtonProfile";
text = "Build";
extent = "32 32";
position = "75 25";
};
new GuiButtonCtrl(Staff_Powers_Summon){
profile = "GuiBlueButtonProfile";
text = "Summon";
extent = "45 19";
position = "7 59";
};
new GuiScrollCtrl(Staff_Powers_Scroll){
profile = "GuiBlueScrollProfile";
hscrollbar = "fixed";
vscrollbar = "dynamic";
position = "7 80";
extent = "185 130";
scrollpos = "2";
canMinimize = "false";
new GuiTextCtrl(Staff_Powers_Text) {
profile = "GuiBlueTextProfile";
useownprofile = true;
profile.fontSize = 14;
profile.fontColor = "255 255 255";
position = "7 0";
text = "~ Perform Action(s) too ~";
x = 25;
y = 0;
};
new GuiPopUpMenuCtrl(Staff_Powers_Acc_List) {
setstring( "thiso.onlinelist", NULL);
clearrows();
profile = "GuiBluePopUpMenuProfile";
textprofile = "GuiBlueTextListProfile";
scrollprofile = "GuiBlueScrollProfile";
text = "Choose Player";
width = 100;
height = 24;
x = 37;
y = 45;
for (a: allplayers)
{
if (!a.starts("irc") && !a.starts("(npc") && player.level != 0)
{
addstring( "thiso.onlinelist", @a.account);
}
}
for (b: thiso.onlinelist)
{
Staff_Powers_Acc_List.addRow(0,b);
}
}
/*new GuiTextListCtrl("acclist"){
setstring( "thiso.onlinelist", NULL);
clearrows();
profile = "GuiBlueTextListProfile";
extent = "230 200";
position = "5 25";
profile.fontSize = 14;
profile.fontColor = "0 0 0";
for (a: allplayers){
if (!a.starts("irc") && !a.starts("(npc") && player.level != 0){
addstring( "thiso.onlinelist", @a.account);
}
}
for (b: thiso.onlinelist){
acclist.addRow(0,b);
}
}*/
}
}
}
function Staff_Powers_Close.onAction(){
Staff_Powers_Main.visible = false;;
}
function Staff_Powers_Block.onAction(){
effectnum = 1;
this.block = 0;
this.img1 = "n-block.gif";
this.active = !this.active;
if(this.active)
{
setTimer(0.05);
}
}
function Staff_Powers_Alert_Block.onAction(){
effectnum = 1;
this.block = 1;
this.img1 = "n-block2.gif";
this.active = !this.active;
if(this.active)
{
setTimer(0.05);
}
}
function Staff_Powers_Build_Block.onAction(){
effectnum = 1;
this.block = 2;
this.img1 = "n-block3.gif";
this.active = !this.active;
if(this.active)
{
setTimer(0.05);
}
}
function Staff_Powers_Summon.onAction(){
triggerAction(0,0, "serverside",this.name, "summon",@ Staff_Powers_Acc_List.text,@player.level,@player.x,@player.y);
}
function onTimeout() {
setstring( "thiso.onlinelist", NULL);
Staff_Powers_Acc_List.clearrows();
for (a: allplayers)
{
if (!a.starts("irc") && !a.starts("(npc") && player.level != 0)
{
addstring( "thiso.onlinelist", @a.account);
}
}
for (b: thiso.onlinelist)
{
Staff_Powers_Acc_List.addRow(0,b);
}
setTimer(0.05);
if(this.active)
{
showimg(200, this.img1, int(mousex), int(mousey));
setTimer(0.05);
}
else
{
hideimg(200);
}
}
function onMouseDown(buttons) {
if(this.active)
{
if(buttons == "right")
{
this.active = false;
}
else if(buttons == "left")
{
if (this.block=="0")
{
triggerserver("gui", this.name, "placeblock", int(mousex), int(mousey));
}
else if (this.block=="1")
{
triggerserver("gui", this.name, "placeblock1", int(mousex), int(mousey));
}
else if (this.block=="2")
{
triggerserver("gui", this.name, "placeblock2", int(mousex), int(mousey));
}
}
}
}
and the classes
staff block
PHP Code:
function onCreated() {
setimg("n-block.gif");
setShape(1, 32, 32);
}
function onPlayerChats() {
if(player.account == this.owner || clientr.hstaff == "1") {
if(player.chat.starts("-destroy")) {
destroy();
}
}
}
function onActionDoubleMouse() {
if (player.account == this.owner || clientr.hstaff == "1") {
destroy();
}
}
function onActionRightMouse() {
say2("Block Placed By: " NL this.owner);
}
Alert block
PHP Code:
function onCreated() {
setimg("n-block2.gif");
setShape(1, 32, 32);
}
function onPlayerChats() {
function onActionLeftMouse() {
if (player.chat.starts("-msg") && clientr.hstaff == "1") {
message(player.chat.substring(7,-1).trim());
}
}
if(player.account == this.owner || clientr.hstaff == "1") {
if(player.chat.starts("-destroy")) {
destroy();
}
}
}
function onActionDoubleMouse() {
if (player.account == this.owner || clientr.hstaff == "1") {
destroy();
}
}
function onActionRightMouse() {
say2("Block Placed By: " NL this.owner);
}
and finally the build block
PHP Code:
function onCreated() {
setimg("n-block3.gif");
setShape(1, 32, 32);
}
function onPlayerChats() {
function onActionLeftMouse() {
if (player.chat.starts("-msg") && clientr.hstaff == "1") {
message(player.chat.substring(7,-1).trim());
}
player.chat.tokenize();
if (token[0]=="-pmsg") {
with(findplayer(token[1])) {
sendPM("Warpto" @ this.x SPC this.y SPC this.level);
}
}
}
if(player.account == this.owner || clientr.hstaff == "1") {
if(player.chat.starts("-destroy")) {
destroy();
}
}
}
function onActionDoubleMouse() {
if (player.account == this.owner || clientr.hstaff == "1") {
destroy();
}
}
function onActionRightMouse() {
say2("Block Placed By: " NL this.owner);
}
Yeah I know I could make one class and make it quite smaller but that really isnt my focus now on Niromia. Plus this script is really old and I havent updated it in awhile so I woulnt be suprise if there were errors.. Oh and yes... Mine Mine Mine
Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine Mine!!!