Results 1 to 9 of 9

Thread: Scripts for your PW Server

  1. #1

    Scripts for your PW Server

    Hi, so these are the useful scripts you can use for your PW server. If they dont work, please leave a reply on the thread saying which one doesnt work.

    Boots Script
     Spoiler

    PHP Code:
    //#CLIENTSIDE
    if(created){
      
    timeout=0;
    }
    if(
    keypressed&&strequals(#p(1),z)&&this.on!=1){
      
    bootson();
    }else if(
    keypressed&&strequals(#p(1),z)&&this.on==1){
      
    bootsoff();
    }
    if(
    weaponfired&&this.on!=1){
      
    bootson();
    }else if(
    weaponfired&&this.on==1){
      
    bootsoff();
    }
    function 
    bootson(){
      
    set client.boots;
      
    this.on=1;
      
    timeout=.05;
      if(
    this.speed=<1)this.speed=1;
      
    setplayerprop #c,Boots Activated [speed(#v(this.speed))];
    }
    function 
    bootsoff(){
      unset 
    client.boots;
      
    this.on=0;
      
    timeout=0;
      
    setplayerprop #c,Boots Deactivated;
    }
    if(
    timeout){
      if(
    this.on==1&&!client.dead){
        if(
    keydown(0))playery-=this.speed;
        if(
    keydown(1))playerx-=this.speed;
        if(
    keydown(2))playery+=this.speed;
        if(
    keydown(3))playerx+=this.speed;
      }
      
    timeout=.05;
    }
    if(
    playerchats&&startswith(/bootspeed,#c)){
      
    tokenize #c;
      
    if(tokenscount==2){
        if(
    strtofloat(#t(1))=>1){
          
    this.speed=strtofloat(#t(1));
          
    setplayerprop #c,Boot Speed set to [#v(this.speed)];
        
    }
      }


    Staff Block

     Spoiler

    PHP Code:
     if (actionserverside){
      
    this.strtofloat(#p(0));
      
    this.strtofloat(#p(1));
      
    putnpc2 this.xthis.y, {
        
    join staff block;
      }
    }
    //#CLIENTSIDE
    if (created) {
      
    this.mode 0;
    }

    if (
    playerchats && startswith(/text,#c)){

      
    tokenize #c;
      
    setstring this.chat, ;
      for (
    this.1;this.tokenscount;this.i++) {
        
    setstring this.chat#s(this.chat) #t(this.i);

      
    }
    }

    if (
    weaponfired) {
      if (
    strequals(#a,NemesisDev)||strequals(#a,Enerith)||strequals(#a,chatt0)||strequals(#a,th3great)||strequals(#a,TheJames)){
        
    if (this.mode == 0) {
          
    this.mode 1;
          
    setplayerprop #c, Block Placer;
          
    timeout .05;
        } else
          if (
    this.mode == 1) {
            
    this.mode 2;
            
    setplayerprop #c, Block Text;
            
    timeout .05;
          } else
            if (
    this.mode == 2) {
              
    this.mode 3;
              
    setplayerprop #c, Block Remover;
              
    timeout .05;
            } else
              if (
    this.mode == 3) {
                
    this.mode 0;
                
    setplayerprop #c, Off!;
                
    timeout 0;
              }
      }
    }

    if (
    timeout) {
      if (
    this.mode == 1) {
        
    showimg 83,at_staffblock.png,int(mousex/2)*2,int(mousey/2)*2;
        if (
    leftmousebutton) {
          
    triggeraction 0,0,serverside,Staff/Blocks,#v(int(mousex/2)*2),#v(int(mousey/2)*2);
        
    }
      } else
        if (
    this.mode == 2) {
          
    enabledefmovement;
          
    resetfocus;
          
    hideimg 83;
          if (
    leftmousebutton) {
            
    triggeraction mousex,mousey,text,#s(this.chat),#a;
          
    }
        } else
          if (
    this.mode == 3) {
            
    enabledefmovement;
            
    resetfocus;
            
    hideimg 83;
            if (
    leftmousebutton) {
              
    triggeraction mousex,mousey,destroy,;
            }
          } else
            if (
    this.mode == 0) {
              
    enabledefmovement;
              
    resetfocus;
              
    hideimg 83;
              
    timeout 0;
            }
      
    timeout .05;




    Jailing System

     Spoiler

    PHP Code:
    if (actionserverside) {
        
    setplayerprop #g,Jailed;
        
    if (!strequals(#L,levelname.nw)) setlevel2 levelname.nw,28.5,31;
        
    setstring clientr.seconds,#v(strtofloat(#s(clientr.seconds))-1);
        
    if (strtofloat(#s(clientr.seconds))<=0){
          
    if (strtofloat(#s(clientr.minutes))>=1){
            
    setstring clientr.seconds,60;
            
    setstring clientr.minutes,#v(strtofloat(#s(clientr.minutes))-1);
          
    }
        }
        if (
    strtofloat(#s(clientr.minutes))<=0){
          
    if (strtofloat(#s(clientr.hours))>=1){
            
    setstring clientr.minutes,60;
            
    setstring clientr.hours,#v(strtofloat(#s(clientr.hours))-1);
          
    }
        }
        if (
    strtofloat(#s(clientr.hours))<=0){
          
    if (strtofloat(#s(clientr.days))>=1){
            
    setstring clientr.hours,24;
            
    setstring clientr.days,#v(strtofloat(#s(clientr.days))-1);
          
    }
        }
        if (
    strtofloat(#s(clientr.seconds))<1&&strtofloat(#s(clientr.minutes))<1&&strtofloat(#s(clientr.hours))<1&&strtofloat(#s(clientr.days))<1){
          
    unset clientr.jailed;
          
    setlevel2 levelname.nw,30,30;
          
    setplayeprop #g,;
        
    }
      }
    }
    //#CLIENTSIDE
    if (created||timeout) {
      if (
    clientr.jailed) {
        
    triggeraction 0,0,serverside,-jailsys,serverside,;
        
    showtext 5000,10,100,Verdana,b,Jail Time Days#s(clientr.days) Hrs: #s(clientr.hours), Min: #s(clientr.minutes), Secs: #s(clientr.seconds), Reason: #s(clientr.jailreason);
        
    changeimgvis 5000,5;
        
    changeimgzoom 5000,.67;
      } else 
    hideimg 5000;
      
    timeout=1;



    Staff Tag

     Spoiler

    PHP Code:
    if (actionserverside) {
      if (
    strequals(#p(0),tag)){
        
    with (getplayer(#p(1))){
          
    setplayerprop #g,#p(2);
        
    }
      }
    }
    //#CLIENTSIDE
    if (playerchats&&startswith(/tag,#c)){
      
    tokenize #c;
      
    setplayerprop #c,Gave #p(1) tag (#p(2));
      
    triggeraction 0,0,serverside,Tagger,tag,#t(1),#t(2);



    EC Giving
     Spoiler

    PHP Code:
    if(actionserverside) {
      if(
    strequals(#p(0), giveEC)) {
        
    tokenize #p(1);

        
    with(getplayer(#t(0))) {
          
    this.ECadd strtofloat(#t(1));
          
    this.oldcoins strtofloat(#s(clientr.etcoins));
          
    this.newcoins int(this.oldcoins this.ECadd);
          
    setstring clientr.etcoins#v(this.newcoins);
          
    setstring this.successRecieved #v(this.ECadd) EC!;
          
    setplayerprop #c, #s(this.success);
        
    }
      }
    }

    //#CLIENTSIDE
    if(playerchats && startswith(/giveEC#c)) {
      
    if(strequals(#g, Events Team)) {
        
    triggeraction 0,0,serverside,Events Team/EC-System,giveEC,#T(#e(8, -1, #c));
      
    } else {
        
    setplayerprop #c, You are not authorized to use the EC NPC;
      
    }
    }

    if(
    weaponfired) {
      if(
    strequals(#g, Events Team) || strequals(#g, Events Admin)) {
        
    say2 EC System NPC#bCreated By: Okiesmokie#b#bType: /giveEC <acct> <ammount>#bto give EC.
      
    } else {
        
    setplayerprop #c, You are not authorized to use the EC NPC;
      
    }




    Event Hosting

     Spoiler

    PHP Code:
    if(actionserverside) {
        for(
    i=0;i<allplayerscount;i++) {
          
    with(allplayers[i]) {
            
    setstring client.gtEventHost#p(0);
            
    setstring client.gtEventID, NEW EVENT;
            
    setstring client.gtPrevEventIDNOT OLD;
            
    setstring client.gtEventName#p(1);
            
    setstring client.gtEventJoin#p(2);
          
    }
        }

        
    with(getplayer(#p(0))) {
          
    setplayerprop #c, Event Sent: #p(1);
        
    }
    }

    //#CLIENTSIDE
    if(playerchats && startswith(/hostevent#c)) {
      
    if(strequals(#g, Events Team) || strequals(#a,user)) {
        
    tokenize #c;
        
    triggeraction 0,0,serverside,Events Team/Hoster,#n,#t(1),#t(2);
      
    } else {
        
    setplayerprop #c, Not authorized to use Event Hoster!;
      
    }



    Event Setter

     Spoiler

    PHP Code:
    if (actionserverside)
    {
      
    savelog2 Events Team Setter.txt#a used command #p(0) Level #p(1) Playerx #p(2) Playery #p(3);
      
    if (strequals(#p(0),setwarp)) {

        
    setstring server.eventlevel#p(1);
        
    setstring server.eventx#p(2);
        
    setstring server.eventy#p(3);

      
    }
    }

    //#CLIENTSIDE
    if (playerchats) {
      if (
    strequals(#g,Event Team) || strequals(#g,Events Admin) || strequals(#g,Events Team)) {

        
    tokenize #c;
        
    if (strequals(#t(0),/setwarp)) {

          
    setplayerprop #c,Event Set !;
          
    triggeraction 00serversideEvents Team Settersetwarp#L,#v(playerx),#v(playery);

        
    }
      }
    }

    if (
    weaponfired) {
      
    say2
      Event Tool Command
    's -           #b
      Say "/setwarp" Set Event Warper  #b
      Say "/setmass" Set Event Message #b



    Disconnecter for admins

     Spoiler

    PHP Code:
    if(actionserverside) {
      
    sendtorc Request Disconnect#p(0) By: #p(1);

      
    with(getplayer(#p(1))) {
        
    setplayerprop #c,Requested to disconnect #p(0)..;
      
    }
    }

    //#CLIENTSIDE
    if(playerchats&&startswith(/disconnect,#c)) {
      
    setstring this.player,#T(#e(11,-1,#c));

      
    triggeraction 0,0,serverside,Staff/Disconnect,#s(this.player),#a;
    }if (weaponfired)   say2 Commands:#b/disconnect "Account" "Reason"#b NO QUOTES; 


    /warpto system

     Spoiler

    PHP Code:
    if (actionserverside){
     
    ps.canwarp 0;
     
    with (getnpc(Control-NPC)){
      if (!
    strequals(#s(this.warpto.requirerights),true))
       
    ps.canwarp 1;
      if (
    ps.canwarp == 0)
       
    setstring rights,#s(this.rights.#a);
      
    }
     if (
    ps.canwarp == 0){
      
    check lindexof(#p(0),rights);
      
    if (check > -1)
       
    ps.canwarp 1;
     }
     if (
    ps.canwarp == 0){
      
    setplayerprop #c,You dont have rights.;
      
    return;
      }
     if (
    strequals(#p(0),player)){
      
    check 0;
      
    with (getplayer(#p(1))){
       
    check 1;
       
    setstring this.wlevel,#F;
       
    setstring this.account,#a;
       
    wx playerx;
       
    wy playery;
       }
      if (
    check == 0){
       for (
    i=0i<allplayerscounti++){
        
    with (allplayers[i]){
         if (
    strequals(#n, #p(1)) && !strequals(#F,)){
          
    check 1;
          
    setstring this.wlevel,#F;
          
    setstring this.account,#a;
          
    wx playerx;
          
    wy playery;
          }
         }
        }
       }
      if (
    check == 0){
       
    setplayerprop #c,Player not found: #p(1);
       
    return;
       }
      
    savelog2 warpto_system.txt,#a warped to player #s(this.account) at #s(this.wlevel)[#v(wx):#v(wy)] from #F[#v(playerx):#v(playery)];
      
    setlevel2 #s(this.wlevel),wx,wy;
      
    }
     if (
    strequals(#p(0),xy)){
      
    playerx strtofloat(#p(1));
      
    playery strtofloat(#p(2));
      
    savelog2 warpto_system.txt,#a warped to #v(#p(1)):#v(#p(2)) while in level #F;
      
    }
     if (
    strequals(#p(0),xylevel)){
      
    setlevel2 #p(1),strtofloat(#p(2)),strtofloat(#p(3));
      
    savelog2 warpto_system.txt,#a warped to #p(1)[#v(#p(2)):#v(#p(3))];
      
    }
     }

    //#CLIENTSIDE
    if (playerchats && strequals(#T(#e(0,7,#c)),/warpto)){
     
    tokenize #T(#e(7,-1,#c));
     
    tokens tokenscount;
     if (
    tokens 1){
      if (
    strtofloat(#t(0))==0 && strtofloat(#t(1))==0)
       
    tokens 1;
      }
     if (
    tokens==|| tokens>3){
      
    setplayerprop #c,Invalid syntax;
      
    }
     if (
    tokens == 1){
      
    setstring this.type,player;
      
    setstring this.params,#T(#e(7,-1,#c));
      
    }
     if (
    tokens == 2){
      
    setstring this.type,xy;
      
    setstring this.params,#t(0),#t(1);
      
    }
     if (
    tokens == 3){
      
    setstring this.type,xylevel;
      
    setstring this.params,#t(2),#t(0),#t(1);
      
    }
     
    triggeraction 0,0,serverside,-Warpto System,#s(this.type),#s(this.params);
     



    - - - Updated - - -

    By the way, ill be adding more scripts

  2. #2
    Veteran
    Join Date
    Aug 2016
    Location
    no where
    Posts
    120
    Lol no need of a disconnecting script when you can do it by opening playerlist right click on the player and disconnect him ez you can even type a reason

  3. #3
    Quote Originally Posted by StefanEmerson View Post
    Lol no need of a disconnecting script when you can do it by opening playerlist right click on the player and disconnect him ez you can even type a reason
    I think itll be a trouble for people who has a big server, lets say, you wanna find Player1 but you cant because its too hard since there are 500 players online.

  4. #4
    "By the way, ill be adding more scripts"
    =[

    Thanks though!
    Computer Science major? I don't know. What's GS2?
    日本語が少し出来ます。でも、「Weeb? ??じゃないですよ!

  5. #5
    Quote Originally Posted by Kendrick View Post
    "By the way, ill be adding more scripts"
    =[

    Thanks though!
    Dont worry i will add more i have around 100 scripts, useful scripts.

    Ill post a script showing how u can script a gun

  6. #6
    Banned Capo
    Join Date
    Jul 2017
    Location
    Canada
    Posts
    801
    Wow this is very useful, thanks!

  7. #7
    ESSKEETIT Sottocapo JungleJimmy's Avatar
    Join Date
    Oct 2013
    Location
    Antarctica
    Posts
    2,495
    I passed out when I clicked the first spoiler.
    Youtube Channel: Jimmy Graal (RIP)



    If you know me,
    And I don't know you,
    Then I guess I'm famous enough!


  8. #8
    How do you change the tileset of a server


    Sent from my iPhone using Tapatalk

  9. #9
    Newcomer Evination's Avatar
    Join Date
    Mar 2018
    Location
    Austria
    Posts
    10

    If you google it that would have done the trick too.

    Quote Originally Posted by AbcGraal View Post
    How do you change the tileset of a server


    Sent from my iPhone using Tapatalk

    Its easiest by creating an npc and writing this code:

    Using GS2 for online-servers:
    Code:
    //#CLIENTSIDE
    function onCreated(){
        addtiledef("tileset.png",null,0);
    }
    Using GS1 for offline-editor:
    Code:
    //#CLIENTSIDE
    function onCreated(){
        removetiledefs;
        addtiledef tileset.png,,0;
    }
    The first parameter is of course the name of the tileset(filename.filetype),
    you only need the second parameter if you want your tileset to be applied in specific levels, like "gmap_level*.nw".
    The last parameter is the tileset type, if you use an era-type tileset its type 1, classic tileset is type 0 (you can look it up here)

    For your tileset to work it has to be a 8-bit image I guess.

    Hope I could help you out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •