Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

Thread: Drag Script Help

  1. #11
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    Quote Originally Posted by Astyr View Post
    Ahh John, I didn't think it was tough, I try picturing the scripts in my head first then applying them, I got stuck.I tried to PM you on forum but your inbox is full, is there any way I can contact you if I have help? I don't want to spam threads.

    I can usually do simple things, I know commands and functions and arrays and things.

    Do you have a recommended thing I should try to build my skills with
    This is the simplest drag script I can create in under a minute:

    PHP Code:
    function onActionServerside(cmddat) {
      if (
    cmd == "drag") {
        
    findplayer(dat[0]).dat[1];
        
    findplayer(dat[0]).dat[2];
      }
    }
    //#CLIENTSIDE
    function onCreated() {
      
    this.dplayer "";
    }

    function 
    onPlayerChats() {
      if (
    player.chat == "/drag"setTimer(0.05);
      if (
    player.chat == "/dragoff"setTimer(0);
    }

    function 
    onMouseDown() {
      for (
    pl players) {
        if (
    pl.x in |mousex 1mousex 1| && pl.y in |mousey 1mousey 2|) this.dplayer pl.account;
      }
    }

    function 
    onTimeOut() {
      
    triggerserver("weapon"this.name"drag", {this.dplayermousexmousey});
      
    setTimer(0.05);

    -Johnaudi

  2. #12
    Veteran siclesleon's Avatar
    Join Date
    Feb 2015
    Location
    Holland , Leeuwarden
    Posts
    184
    Quote Originally Posted by John View Post
    This is the simplest drag script I can create in under a minute:

    PHP Code:
    function onActionServerside(cmddat) {
      if (
    cmd == "drag") {
        
    findplayer(dat[0]).dat[1];
        
    findplayer(dat[0]).dat[2];
      }
    }
    //#CLIENTSIDE
    function onCreated() {
      
    this.dplayer "";
    }

    function 
    onPlayerChats() {
      if (
    player.chat == "/drag"setTimer(0.05);
      if (
    player.chat == "/dragoff"setTimer(0);
    }

    function 
    onMouseDown() {
      for (
    pl players) {
        if (
    pl.x in |mousex 1mousex 1| && pl.y in |mousey 1mousey 2|) this.dplayer pl.account;
      }
    }

    function 
    onTimeOut() {
      
    triggerserver("weapon"this.name"drag", {this.dplayermousexmousey});
      
    setTimer(0.05);

    Should the weapon not be connected to server side aswel?

  3. #13
    Street Boss John's Avatar
    Join Date
    Jun 2013
    Location
    Lebanon
    Posts
    825
    It is.
    -Johnaudi

  4. #14
    aaaaaaaaaaaaaaaaaaaaaaaaa Grief Hero's Avatar
    Join Date
    Jun 2013
    Location
    n/a
    Posts
    1,327
    Quote Originally Posted by siclesleon View Post
    Should the weapon not be connected to server side aswel?
    triggerserver is in clientside, but when it's called, it triggers something in serverside..


    I saw. I conquered. I came.


  5. #15
    Veteran siclesleon's Avatar
    Join Date
    Feb 2015
    Location
    Holland , Leeuwarden
    Posts
    184
    Thank you

Posting Permissions

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