Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   JKL's Scripting Questions (https://forums.graalonline.com/forums/showthread.php?t=134258195)

jkldogg 03-14-2010 03:31 PM

Quote:

Originally Posted by xAndrewx (Post 1562452)
Please re-read the thread.

I hate how you try to help, but you just beat around the bush and never actually help. You just give little small tips..that is annoying.

Quote:

Originally Posted by DrakilorP2P (Post 1562467)
Playing a gani with sound in it doesn't stop the jukebox, and neither does it stop if you do play("foo.wav"). I suppose there could be a gun sound played from URL somewhere.

jkldogg, you should probably just find someone to scan your scripts for you.

I don't know anyone trustworthy to scan my scripts..Except Alfonso, Chris Vimes, Switch, and Tig.

Who else? Will someone just come fix the stupid juke box..?

xAndrewx 03-14-2010 04:00 PM

Well that's rather rude- considering I'm one of the people trying to help you;

Please look in to your gani folder for the "firing" ganis, open that file in "NOTEPAD" or "WORDPAD" (right click the file > click the option "open with...") and delete the line that says "PLAYSOUND".

This has been mentioned twice in this thread, please can you show some gratitude as we're helping you.

jkldogg 03-14-2010 05:01 PM

Quote:

Originally Posted by xAndrewx (Post 1562469)
Well that's rather rude- considering I'm one of the people trying to help you;

Please look in to your gani folder for the "firing" ganis, open that file in "NOTEPAD" or "WORDPAD" (right click the file > click the option "open with...") and delete the line that says "PLAYSOUND".

This has been mentioned twice in this thread, please can you show some gratitude as we're helping you.

Rep+

This is what i've been waiting for. Tell me exactly what to do. For that, I thank you. Respect has been earned.

Liberated 03-14-2010 05:10 PM

Quote:

Originally Posted by jkldogg (Post 1562474)
Rep+

This is what i've been waiting for. Tell me exactly what to do. For that, I thank you. Respect has been earned.

You should learn to do things on your own, you won't really learn, or accomplish anything, if everything is chewed out for you.

jkldogg 03-14-2010 05:28 PM

Quote:

Originally Posted by Liberated (Post 1562477)
You should learn to do things on your own, you won't really learn, or accomplish anything, if everything is chewed out for you.

Why don't you teach me or get off my post?

jkldogg 03-14-2010 05:34 PM

Attempted to Create A window my self
 
Tried to learn how to use the GUI Editor.

Can someone tell me where I made an error? Because in RC, it doesn't say any errors.

It worked, but It doesn't come up when I press the key "9"

PHP Code:

function onKeyPressedcodekey )
{
  if ( 
key == "9" )
  {
    
triggerserver"gui"name"getMessage" );
  }


Or When on a chat command.


PHP Code:

function onPlayerChats()
{
  if ( 
player.chat == ":test" )
  {
    
triggerserver"gui"name"getMessage" );
  }


Here's the full code
PHP Code:

//#CLIENTSIDE
function onKeyPressedcodekey )
{
  if ( 
key == "9" )
  {
    
triggerserver"gui"name"getMessage" );
  }

function 
onPlayerChats()
{
  if ( 
player.chat == ":test" )
  {
    
triggerserver"gui"name"getMessage" );
  }
}  

function 
onCreated() {
  new 
GuiWindowCtrl("test_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "114,94";

    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Poll";
    
585;
    
265;

    new 
GuiCheckBoxCtrl("test_CheckBox1") {
      
profile GuiBlueCheckBoxProfile;
      
height 20;
      
text "Yes";
      
width 100;
      
13;
      
31;
    }
    new 
GuiCheckBoxCtrl("test_CheckBox2") {
      
profile GuiBlueCheckBoxProfile;
      
height 20;
      
text "No";
      
width 100;
      
13;
      
56;
    }
    new 
GuiTextCtrl("test_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Do you like pie?";
      
width 75;
      
9;
      
7;
    }
  }


Can someone please help!

TSAdmin 03-14-2010 05:59 PM

Quote:

Originally Posted by jkldogg (Post 1562468)
You just give little small tips..that is annoying.

To be fair, he's just following the rules of the Scripting Forum which I implore you to read before making hostile posts.

Quote:

Originally Posted by Scripting Forum Rules
1. Be clear on your ability level. In other words, do not post asking for scripts, or asking people to fix scripts that are above your ability level. If you are writing a script to aid learning, then try writing a simpler script. If you are looking for a script for a server, then the best solution is probably to hire a scripter.

I have taken the liberty of bolding the part you don't seem to understand about why people are only giving "Small tips". If the small tips that you are getting are not helping you in your mind, even though they have been posted multiple times by multiple people, then that is considered "Above your skill level" and you should probably consider a simpler script.

Quote:

Originally Posted by Scripting Forum Rules
2. Similarly, do not just post whole scripts for people as a response to their difficulties. If you wish to post a wordy solution, then please feel free; however, please do not post things that people can just copy and paste. It isn't helping people to learn just by doing so. If you'd like to show off your scripts to others, post them in the Code Gallery subforum.

and above, I have bolded the part of the rules in which Andrew is following and you are not happy about. By copying the whole thing and reposting it for you with the alterations, they are "Posting a whole script as a response to your difficulties", which obviously would only be done if rule 1 were ignored because of the "It's above your skill level".

Overall, many would really appreciate it if you could recognise where you are in over your head and beyond your skill level before becoming so hostile toward people following the rules. Click here and please read the rules of the Scripting Forum. You will need to scroll down to Skyld's post, which is after Stefan's.

jkldogg 03-14-2010 06:03 PM

lol
 
^ View my first post on this page!

Quote:

Originally Posted by TSAdmin (Post 1562492)
To be fair, he's just following the rules of the Scripting Forum which I implore you to read before making hostile posts.



I have taken the liberty of bolding the part you don't seem to understand about why people are only giving "Small tips". If the small tips that you are getting are not helping you in your mind, even though they have been posted multiple times by multiple people, then that is considered "Above your skill level" and you should probably consider a simpler script.



and above, I have bolded the part of the rules in which Andrew is following and you are not happy about. By copying the whole thing and reposting it for you with the alterations, they are "Posting a whole script as a response to your difficulties", which obviously would only be done if rule 1 were ignored because of the "It's above your skill level".

Overall, many would really appreciate it if you could recognise where you are in over your head and beyond your skill level before becoming so hostile toward people following the rules. Click here and please read the rules of the Scripting Forum. You will need to scroll down to Skyld's post, which is after Stefan's.

No, it isn't above my skill level to erase a line of text. There were 3 lines of "PLAY SOUND" or whatever so I deleted them all and the sound went away, so I was confused. Because he simply said "delete play sound" so i came back to see what the problem was. And then he helped.

xAndrewx 03-14-2010 06:07 PM

PHP Code:

function onKeyPressed(codekey) {
  if (
temp.key != 9) return; //If its not the 9 key, do nothing

  
test_Window1.visible = !test_Window1.visible//A toggle option to display or hide the window


function 
onCreated() {
  new 
GuiWindowCtrl("test_Window1") {
  
//ADD THIS LINE IN HERE, so it's not always showing when you update the script
    
visible false;
  
//REST OF YOUR STUFF HERE 
  
}


Try this, it should work

cbk1994 03-14-2010 06:14 PM

How does this man still have a green rep bar?

fowlplay4 03-14-2010 06:19 PM

Quote:

Originally Posted by TSAdmin (Post 1562492)
Overall, many would really appreciate it if you could recognise where you are in over your head and beyond your skill level before becoming so hostile toward people following the rules. Click here and please read the rules of the Scripting Forum. You will need to scroll down to Skyld's post, which is after Stefan's.

So that's where those were.

Also jkl, read the following: http://wiki.graal.us/onActionServerSide

You should notice that triggerserver does not do anything with the GUI window.

You can hide/show a GUI window with this line of code:

NameOfGUIObject.show();
NameOfGUIObject.hide();

There are many other functions that GUI Objects contain: http://wiki.graal.net/index.php/Crea...ent/GuiControl

This is probably the last bit of help you're going to get if you keep up the ignorant behavior which will result in your banning.

Links that may help:

http://wiki.graal.us/ - Skyld's Documentation
http://wiki.graal.net/index.php/Creation/Dev/GScript - gBible Documentation contains a couple tutorials
http://public.zodiacdev.com/index.php?title=Fowlplay4 - Tutorial I started work on, that still needs work.

I'd also recommend you try learning how to program in general and try to wrap your head around the logic involved.

jkldogg 03-14-2010 06:26 PM

no curr
 
Quote:

Originally Posted by xAndrewx (Post 1562498)
PHP Code:

function onKeyPressed(codekey) {
  if (
temp.key != 9) return; //If its not the 9 key, do nothing

  
test_Window1.visible = !test_Window1.visible//A toggle option to display or hide the window


function 
onCreated() {
  new 
GuiWindowCtrl("test_Window1") {
  
//ADD THIS LINE IN HERE, so it's not always showing when you update the script
    
visible false;
  
//REST OF YOUR STUFF HERE 
  
}


Try this, it should work

Works like a charm, much appreciated. You help the most.

Quote:

Originally Posted by cbk1994 (Post 1562500)
How does this man still have a green rep bar?

1.) Me?
2.) Why do I care?
3.) I don't even know what rep does.. Repuatation?
4.) Do you not remember me chris?
5.) Era? Lol, like I care what others think.

TSAdmin 03-14-2010 06:37 PM

Quote:

Originally Posted by jkldogg (Post 1562504)
1.) Me?
2.) Why do I care?
3.) I don't even know what rep does.. Repuatation?
4.) Do you not remember me chris?
5.) Era? Lol, like I care what others think.

I don't mean to be a pain, but do you think this is the reason why you're not getting a lot of help in a thread you made asking for help? This is the kind of hostility I was talking about earlier. Please, tone it down... a lot.

jkldogg 03-14-2010 06:39 PM

Quote:

Originally Posted by TSAdmin (Post 1562508)
I don't mean to be a pain, but do you think this is the reason why you're not getting a lot of help in a thread you made asking for help? This is the kind of hostility I was talking about earlier. Please, tone it down... a lot.

Chris Vimes knows what's up. He says he likes me on Era a few months ago and now he's mad. OH WELL. I'm done with that crap. I was in a position of "half-way-caring" which is like caring but only to an extent. That extent is gone. :whatever:

jkldogg 03-14-2010 06:45 PM

Health Respawn problem
 
SORRY DOUBLE POST.

Personally scripted by *Switch for use only on Vega United.

The problem is whenever you die, a little watermark appears and you press Space bar to revive, this worked fine. But switch came back and altered the script and now it doesn't let you respawn. You must reconnect to the server to revive. This is extremely annoying, and many of our players have stopped coming because of this reason. Help is appreciated, please and thank you in advance.

I tried to fix it by altering this code, but I think I did more harm than good? >_<

PHP Code:

  layer 4;
      
red green blue 0;
      
mode 1;
      
alpha 0.7;
    }
    
with (findImg(201)) {
      
text "Press spacebar to revive.";
      
GraalControl.width/2GraalControl.height/2+GraalControl.height/3.5;
      
layer 4;
      
style "c";
      
red green blue 1;
      
zoom GraalControl.width/600;
    }
  }
  else {
    
hideImgs(200201);
  }
}
function 
GraalControl.onResize() {
  if (
clientr.health_current == null) {
    
with (findImg(200)) {
      
polygon = {GraalControl.width/2-GraalControl.width/5GraalControl.height/2+GraalControl.height/4,
                 
GraalControl.width/2+GraalControl.width/5GraalControl.height/2+GraalControl.height/4

Here's the full code.
PHP Code:

function onActionServerside(cmdp1p2) {
  if (
cmd == "setstats") {
    
clientr.health_current clientr.health_max 100;
    
clientr.armor_current clientr.armor_max 0;
    
onHeal(player.account);
  }
  if (
cmd == "hurt") {
    if (!
player.level.isnopkzone) {
      if (
clientr.armor_current 0) {
        if (
clientr.armor_current >= p1) {
          
clientr.armor_current -= p1;
          if (
clientr.armor_current 0) {
            
clientr.armor_max 0;
          }
          
player.ani "hurt";;
          
scheduleEvent(1"Unhurt"player.account);
        }
        else {
          
temp.remain p1-clientr.armor_current;
          
clientr.armor_current clientr.armor_max 0;
          
clientr.health_current -= temp.remain;
          if (
clientr.health_current <= 0) {
            
clientr.health_current 0;
            
death(p2);
          }
        }
      }
      else if (
clientr.health_current 0) {
        if (
clientr.health_current p1) {
          
clientr.health_current -= p1;
          
player.ani "hurt";
          
scheduleEvent(1"Unhurt"player.account);
        }
        else {
          
clientr.health_current 0;
          
death(p2);
        }
      }
    }
  }
  else if (
cmd == "respawn") {
    
onHeal(player.account);
  }
  
triggerClient("gui"this.name);
}
function 
onUnhurt(pl) {
  if (
player.ani == "hurt") {
    
player.ani "idle";
  }
}
function 
death(pl) {
  
player.ani "dead";
  
freezePlayer2();
  
clientr.deaths++;
  
clientr.dead true;
  
player.chat "" @findPlayer(pl).communityname"!";
  
findPlayer(pl).clientr.kills++;
  
findPlayer(pl).chat "" @player.communityname"!";
}
function 
onHeal(pl) {
  
findPlayer(pl).ani "idle";
  
clientr.dead false;
  
findPlayer(pl).clientr.health_current findPlayer(pl).clientr.health_max;
  
findPlayer(pl).unfreezePlayer();
  
findPlayer(pl).setLevel2("overworld_ad-ae.nw"9.37562.5);
  
findPlayer(pl).triggerClient("gui"this.name);
}

//#CLIENTSIDE
function onCreated() {
  
Health this;
  if (
clientr.health_current == null) {
    
triggerServer("gui"this.name"setstats");
  }
}
function 
GraalControl.onKeyPressed(codekeyscan) {
  if (
clientr.health_current == null) {
    if (
scan == 0) {
      
triggerServer("gui"this.name"respawn");
    }
  }
}
function 
onActionClientside() {
  
HUD.findImg(201).width = ((clientr.health_current/clientr.health_max)*82)/16;
  if (
clientr.health_current 0) {
    
HUD.findImg(201).alpha 1;
  }
  else {
    
HUD.findImg(201).alpha 0;
  }
  
HUD.findImg(202).text clientr.health_current"/" @clientr.health_max;
  
HUD.findImg(203).width = ((clientr.health_current/clientr.health_max)*82)/16;
  if (
clientr.armor_current 0) {
    
HUD.findImg(203).alpha 1;
  }
  else {
    
HUD.findImg(203).alpha 0;
  }
  
HUD.findImg(204).text = (clientr.armor_current == null?"0/0":clientr.armor_current"/"clientr.armor_max);
  if (
clientr.health_current == null) {
    
with (findImg(200)) {
      
polygon = {GraalControl.width/2-GraalControl.width/5GraalControl.height/2+GraalControl.height/4,
                 
GraalControl.width/2+GraalControl.width/5GraalControl.height/2+GraalControl.height/4,
                 
GraalControl.width/2+GraalControl.width/5GraalControl.height/2+GraalControl.height/3,
                 
GraalControl.width/2-GraalControl.width/5GraalControl.height/2+GraalControl.height/3};
      
layer 4;
      
red green blue 0;
      
mode 1;
      
alpha 0.7;
    }
    
with (findImg(201)) {
      
text "Press spacebar to revive.";
      
GraalControl.width/2GraalControl.height/2+GraalControl.height/3.5;
      
layer 4;
      
style "c";
      
red green blue 1;
      
zoom GraalControl.width/600;
    }
  }
  else {
    
hideImgs(200201);
  }
}
function 
GraalControl.onResize() {
  if (
clientr.health_current == null) {
    
with (findImg(200)) {
      
polygon = {GraalControl.width/2-GraalControl.width/5GraalControl.height/2+GraalControl.height/4,
                 
GraalControl.width/2+GraalControl.width/5GraalControl.height/2+GraalControl.height/4,
                 
GraalControl.width/2+GraalControl.width/5GraalControl.height/2+GraalControl.height/3,
                 
GraalControl.width/2-GraalControl.width/5GraalControl.height/2+GraalControl.height/3};
      
layer 4;
      
red green blue 0;
      
mode 1;
      
alpha 0.7;
    }
    
with (findImg(201)) {
      
text "Press spacebar to revive.";
      
GraalControl.width/2GraalControl.height/2+GraalControl.height/3.5;
      
layer 4;
      
style "c";
      
red green blue 1;
      
zoom GraalControl.width/600;
    }
  }
}

function 
onActionProjectile(bdmgpl) {
  if (
== "bullet") {
    
triggerServer("gui"this.name"hurt"dmgpl);
  }



DrakilorP2P 03-14-2010 06:55 PM

Quote:

Originally Posted by jkldogg (Post 1562511)
SORRY DOUBLE POST.

The problem is whenever you die, a little watermark appears and you press Space bar to revive, this worked fine. But switch came back and altered the script and now it doesn't let you respawn. You must reconnect to the server to revive. This is extremely annoying, and many of our players have stopped coming because of this reason. Help is appreciated, please and thank you in advance.

I tried to fix it by altering this code, but I think I did more harm than good? >_<

Here's the full code.
PHP Code:

function onActionServerside(cmdp1p2) {
  if (
cmd == "setstats") {
    
clientr.health_current clientr.health_max 100;
    
clientr.armor_current clientr.armor_max 0;
    
onHeal(player.account);
  }
  if (
cmd == "hurt") {
    if (!
player.level.isnopkzone) {
      if (
clientr.armor_current 0) {
        if (
clientr.armor_current >= p1) {
          
clientr.armor_current -= p1;
          if (
clientr.armor_current 0) {
            
clientr.armor_max 0;
          }
          
player.ani "hurt";;
          
scheduleEvent(1"Unhurt"player.account);
        }
        else {
          
temp.remain p1-clientr.armor_current;
          
clientr.armor_current clientr.armor_max 0;
          
clientr.health_current -= temp.remain;
          if (
clientr.health_current <= 0) {
            
clientr.health_current 0;
            
death(p2);
          }
        }
      }
      else if (
clientr.health_current 0) {
        if (
clientr.health_current p1) {
          
clientr.health_current -= p1;
          
player.ani "hurt";
          
scheduleEvent(1"Unhurt"player.account);
        }
        else {
          
clientr.health_current 0;
          
death(p2);
        }
      }
    }
  }
  else if (
cmd == "respawn") {
    
onHeal(player.account);
  }
  
triggerClient("gui"this.name);
}
function 
onUnhurt(pl) {
  if (
player.ani == "hurt") {
    
player.ani "idle";
  }
}
function 
death(pl) {
  
player.ani "dead";
  
freezePlayer2();
  
clientr.deaths++;
  
clientr.dead true;
  
player.chat "" @findPlayer(pl).communityname"!";
  
findPlayer(pl).clientr.kills++;
  
findPlayer(pl).chat "" @player.communityname"!";
}
function 
onHeal(pl) {
  
findPlayer(pl).ani "idle";
  
clientr.dead false;
  
findPlayer(pl).clientr.health_current findPlayer(pl).clientr.health_max;
  
findPlayer(pl).unfreezePlayer();
  
findPlayer(pl).setLevel2("overworld_ad-ae.nw"9.37562.5);
  
findPlayer(pl).triggerClient("gui"this.name);
}

//#CLIENTSIDE
function onCreated() {
  
Health this;
  if (
clientr.health_current == null) {
    
triggerServer("gui"this.name"setstats");
  }
}
function 
GraalControl.onKeyPressed(codekeyscan) {
  if (
clientr.health_current == null) {
    if (
scan == 0) {
      
triggerServer("gui"this.name"respawn");
    }
  }
}
function 
onActionClientside() {
  
HUD.findImg(201).width = ((clientr.health_current/clientr.health_max)*82)/16;
  if (
clientr.health_current 0) {
    
HUD.findImg(201).alpha 1;
  }
  else {
    
HUD.findImg(201).alpha 0;
  }
  
HUD.findImg(202).text clientr.health_current"/" @clientr.health_max;
  
HUD.findImg(203).width = ((clientr.health_current/clientr.health_max)*82)/16;
  if (
clientr.armor_current 0) {
    
HUD.findImg(203).alpha 1;
  }
  else {
    
HUD.findImg(203).alpha 0;
  }
  
HUD.findImg(204).text = (clientr.armor_current == null?"0/0":clientr.armor_current"/"clientr.armor_max);
  if (
clientr.health_current == null) {
    
with (findImg(200)) {
      
polygon = {GraalControl.width/2-GraalControl.width/5GraalControl.height/2+GraalControl.height/4,
                 
GraalControl.width/2+GraalControl.width/5GraalControl.height/2+GraalControl.height/4,
                 
GraalControl.width/2+GraalControl.width/5GraalControl.height/2+GraalControl.height/3,
                 
GraalControl.width/2-GraalControl.width/5GraalControl.height/2+GraalControl.height/3};
      
layer 4;
      
red green blue 0;
      
mode 1;
      
alpha 0.7;
    }
    
with (findImg(201)) {
      
text "Press spacebar to revive.";
      
GraalControl.width/2GraalControl.height/2+GraalControl.height/3.5;
      
layer 4;
      
style "c";
      
red green blue 1;
      
zoom GraalControl.width/600;
    }
  }
  else {
    
hideImgs(200201);
  }
}
function 
GraalControl.onResize() {
  if (
clientr.health_current == null) {
    
with (findImg(200)) {
      
polygon = {GraalControl.width/2-GraalControl.width/5GraalControl.height/2+GraalControl.height/4,
                 
GraalControl.width/2+GraalControl.width/5GraalControl.height/2+GraalControl.height/4,
                 
GraalControl.width/2+GraalControl.width/5GraalControl.height/2+GraalControl.height/3,
                 
GraalControl.width/2-GraalControl.width/5GraalControl.height/2+GraalControl.height/3};
      
layer 4;
      
red green blue 0;
      
mode 1;
      
alpha 0.7;
    }
    
with (findImg(201)) {
      
text "Press spacebar to revive.";
      
GraalControl.width/2GraalControl.height/2+GraalControl.height/3.5;
      
layer 4;
      
style "c";
      
red green blue 1;
      
zoom GraalControl.width/600;
    }
  }
}

function 
onActionProjectile(bdmgpl) {
  if (
== "bullet") {
    
triggerServer("gui"this.name"hurt"dmgpl);
  }



Not sure what is going on, but try replacing
PHP Code:

function GraalControl.onKeyPressed(codekeyscan) { 

with
PHP Code:

function onKeyPressed(codekeyscan) { 

You should probably ask Switch about it since he's the last one who messed with it before it broke.

jkldogg 03-14-2010 07:22 PM

Quote:

Originally Posted by DrakilorP2P (Post 1562513)
Not sure what is going on, but try replacing
PHP Code:

function GraalControl.onKeyPressed(codekeyscan) { 

with
PHP Code:

function onKeyPressed(codekeyscan) { 

You should probably ask Switch about it since he's the last one who messed with it before it broke.

He came back to help, and made it worst. He hasn't been online since. I'll try your remedy.

EDIT: Works like a charm, thanks.

jkldogg 03-14-2010 09:30 PM

Guild Locked door
 
^^Tried to make a guild locked door, for my Squads System...Didn't work too well. Can someone tell me where I went wrong?
Please and thank you in advance. :)

PHP Code:

function onActionGrab() {
      if (
clientr.SquadName == "La Carmelas");
      
setlevel vega_kody-house-inside,30,30;
    }
    function 
onActionGrab() {
      if (
clientr.SquadName "La Carmelas");
      
setlevel vega_staff-meeting,20,20;
    } 


Deas_Voice 03-14-2010 09:38 PM

Quote:

Originally Posted by jkldogg (Post 1562538)
^^Tried to make a guild locked door, for my Squads System...Didn't work too well. Can someone tell me where I went wrong?
Please and thank you in advance. :)

PHP Code:

function onActionGrab() {
      if (
clientr.SquadName == "La Carmelas");
      
setlevel vega_kody-house-inside,30,30;
    }
    function 
onActionGrab() {
      if (
clientr.SquadName "La Carmelas");
      
setlevel vega_staff-meeting,20,20;
    } 


you are doing the function twice, that's a no-can-do.
also, still mixing with gs1, stop that if u want to be a scripter

jkldogg 03-14-2010 09:39 PM

1 function
 
Quote:

Originally Posted by Deas_Voice (Post 1562541)
you are doing the function twice, that's a no-can-do.
also, still mixing with gs1, stop that if u want to be a scripter

So if I take out the second function it will work?

Deas_Voice 03-14-2010 09:41 PM

Quote:

Originally Posted by jkldogg (Post 1562542)
So if I take out the second function it will work?

i don't know? try! :asleep:
srsly man, rc should tell you errors like this!

jkldogg 03-14-2010 09:47 PM

Quote:

Originally Posted by Deas_Voice (Post 1562543)
i don't know? try! :asleep:
srsly man, rc should tell you errors like this!

It should, but doesn't.

xAndrewx 03-14-2010 09:48 PM

HTML Code:

function onActionGrab() {
  if (clientr.SquadName == "La Carmelas") {
    setlevel("vega_kody-house-inside.nw", 30, 30);
  } else {
    setlevel("vega_staff-meeting,nw", 20, 20);
  }
}

This uses the else feature, and you only need one function (onActionGrab)
:)

jkldogg 03-14-2010 09:59 PM

testing
 
1 Attachment(s)
Quote:

Originally Posted by xAndrewx (Post 1562549)
HTML Code:

function onActionGrab() {
  if (clientr.SquadName == "La Carmelas") {
    setlevel("vega_kody-house-inside.nw", 30, 30);
  } else {
    setlevel("vega_staff-meeting,nw", 20, 20);
  }
}

This uses the else feature, and you only need one function (onActionGrab)
:)

I'll try it with one function.

EDIT: I did this and it didn't work.

PHP Code:

function onActionGrab() {
      if (
clientr.SquadName == "Vega") {
        
setlevel("vega_hut.nw"3030);
      } else {
        
setlevel("vega_staff-meeting,nw"2020);
      }
    } 


salesman 03-14-2010 10:48 PM

Quote:

Originally Posted by jkldogg (Post 1562551)
I'll try it with one function.

EDIT: I did this and it didn't work.

PHP Code:

function onActionGrab() {
      if (
clientr.SquadName == "Vega") {
        
setlevel("vega_hut.nw"3030);
      } else {
        
setlevel("vega_staff-meeting,nw"2020);
      }
    } 


try setlevel2()

xAndrewx 03-14-2010 11:02 PM

Oh yeah- haha duh

Switch 03-14-2010 11:17 PM

Quote:

Originally Posted by jkldogg (Post 1562511)
PHP Code:

GraalControl.onKeyPressed(codekeyscan


Change this to GraalControl.onKeyDown(code, key, scan). Forgot to change it when I updated the script.

jkldogg 03-14-2010 11:51 PM

Quote:

Originally Posted by salesman (Post 1562564)
try setlevel2()

Works, thanks.

Quote:

Originally Posted by xAndrewx (Post 1562567)
Oh yeah- haha duh

lol, you had the just of it

Quote:

Originally Posted by Switch (Post 1562570)
Change this to GraalControl.onKeyDown(code, key, scan). Forgot to change it when I updated the script.

Thanks, already did.

DrakilorP2P 03-15-2010 12:03 AM

Quote:

Originally Posted by jkldogg (Post 1562551)
PHP Code:

function onActionGrab() {
      if (
clientr.SquadName == "Vega") {
        
setlevel("vega_hut.nw"3030);
      } else {
        
setlevel("vega_staff-meeting,nw"2020);
      }
    } 


You should probably remove the tabs that come when you copy paste.

jkldogg 03-15-2010 12:17 AM

Quote:

Originally Posted by DrakilorP2P (Post 1562588)
You should probably remove the tabs that come when you copy paste.

When I copy paste what?

Cubical 03-15-2010 12:22 AM

the script

jkldogg 03-15-2010 12:25 AM

Inventory()replace
 
Quote:

Originally Posted by Cubical (Post 1562590)
the script

Okay.

I want to replace the old classic inventory with my own one. I changed the key to "Q", but both inventories popped up..lol How can I easily disable the old classic one? Also, is there a way to drag out items and drop them on the ground?

I thought editing this would help..but I failed

PHP Code:

   player.chat "You can't drop this!";
    return;
  }
  
Inventory_Window.visible false;
  
this.dragging true;
  
this.dragWep = ( @ ct ).weapon;
  
Inventory_DragImg.image = ( @ ct ).weapon.image;
  
Inventory_DragQuantity.text 1;
  
refreshDrag();
  
Inventory_DragImg.visible true;
  
Inventory_DragQuantity.visible true;
  
this.startDrag timevar2;
  
client.frozen true;
}
function 
refreshDrag() 


Here's the code:

PHP Code:

function onActionServerSidecmdwepammimgacc )
{
  }
    
    
//echo(wep SPC clientr.item.( @ wep ) SPC player.account);
    
if ( clientr.item.( @ wep ) >= amm )
    {
      
clientr.item.( @ wep ) -= amm;
      if ( 
clientr.item.( @ wep ) == )
      {
        
removeweaponwep );
      }
      
temp.npc putnpc2dropPosition()[0], dropPosition()[1], "join(\"object_droppeditem\");" );
      
temp.npc.dropper acc;
      
temp.npc.realName wep;
      
temp.npc.itemQuantity amm;
      
temp.npc.itemImage img;
      
clientr.trueMoney base64encodeclientr.item.Money );
      
triggerclient"gui"name"reopenMenu" );
    }
function 
dropPosition()
{
  
temp.playerPos = {{0.751}, {0.61.5}};
  
temp.dropPos = {
                   
player.+ (player.dir in {02}? temp.playerPos[0][0] : temp.playerPos[1][0]) + vecx(player.dir) * 2,
                   
player.+ (player.dir in {02}? temp.playerPos[0][1] : temp.playerPos[1][1]) + vecy(player.dir) * 2
                 
};
  return 
temp.dropPos;
}
//#CLIENTSIDE
function onCreated()
{
  
setTimer0.05 );
}
function 
onActionClientSidecmd )
{
  if ( 
cmd == "reopenMenu" )
  {
    if ( 
this.menu == )
    {
      
destroyMenu();
      
showMenu();
    }
    else
    {
      
destroyMenu();
    }
  }
}
function 
onKeyPressedcodekey )
{
  if ( 
key == "w" )
  {
    
this.menu this.menu;
    if ( 
this.menu )
    {
      
showMenu();
      
setTimer0.05 );
    }
    else
    {
      
destroyMenu();
      
this.scroll 0;
    }
  }
}
function 
onTimeOut()
{
  if ( 
mousewheeldelta )
  {
    if ( 
this.scroll 35 this.iWeps.size() )
    {
      
this.scroll += 5;
      
destroyMenu();
      
showMenu();
    }
  }
  else if ( 
mousewheeldelta )
  {
    if ( 
this.scroll )
    {
      
this.scroll -= 5;
      
destroyMenu();
      
showMenu();
    }
  }
  if ( 
this.dragging )
  {
    
temp.Inventory_DragQuantity.text;
    if ( 
timevar2 this.lastTime >= .1 )
    {
      if ( 
keydown) )
      {
        if ( 
temp.!= clientr.item.( @ this.dragWep.name ) )
        {
          
Inventory_DragQuantity.text temp.1;
          
this.lastTime timevar2;
        }
      }
      if ( 
keydown) )
      {
        if ( 
temp.100 )
        {
          
Inventory_DragQuantity.text temp.100;
          
// this.lastTime = timevar2;
        
}
        else
        {
          
Inventory_DragQuantity.text 1;
          
//this.lastTime = timevar2;
        
}
      }
      if ( 
keydown) )
      {
        if ( 
temp.)
        {
          
Inventory_DragQuantity.text temp.1;
          
this.lastTime timevar2;
        }
      }
      if ( 
keydown) )
      {
        if ( 
temp.100 <= clientr.item.( @ this.dragWep.name ) )
        {
          
Inventory_DragQuantity.text temp.100;
          
//this.lastTime = timevar2;
        
}
        else
        {
          
Inventory_DragQuantity.text clientr.item.( @ this.dragWep.name );
          
//this.lastTime = timevar2;
        
}
      }
    }
    if ( ! 
leftmousebutton )
    {
      
endDragging();
    }
    else
    {
      
refreshDrag();
    }
  }
  if ( 
this.menu )
  {
    
setTimer0.05 );
  }
}
function 
destroyMenu()
{
  
Inventory_Window.destroy();
}
function 
showMenu()
{
  
iWeps.clear();
for ( 
temp.player.weapons )
  {
    
temp.temp.a.name;
    if ( ! 
temp.n.starts"-" ) )
    {
      
iWeps.addtemp.);
    }
  }
  
this.iWeps iWeps;
  
scroll this.scroll;
  new 
GuiShowImgCtrl"Inventory_DragImg" )
  {
    
image "";
    
0;
    
0;
    
visible false;
    
width 32;
    
height 32;
  }
  new 
GuiShowImgCtrl"Inventory_Window" )
  {
    
image "inventory1.png";
    
width 380;
    
height 380;
    
screenwidth - ( width 20 );
    
screenheight - ( height );
    
visible true;
    for ( 
temp.scrolltemp.35 scrolltemp.++ )
    {
      if ( 
temp.iWeps.size() )
      {
        
temp.iWeps[temp.i];
        if ( 
temp.cols == )
        {
          
temp.row ++;
          
temp.cols 0;
        }
        new 
GuiShowImgCtrl"Inventory_Item_" temp.a.name )
        {
          
image temp.a.image;
          
13 + ( 60.5 temp.cols );//108-x/original|35|
          
+ ( 43.5 temp.row );//9-y/original|35|
          //Newer Old-x=27.5
          //Newer Old-y=96
          
width 32;
          
height 32;
          
hint temp.a.name;
          
this.weapon temp.a;
          
thiso.catcheventname"onMouseDown""onItemClicked" );
          
thiso.catcheventname"onMouseDragged""onItemDragged" );
        }
        
temp.cols ++;
      }
    }
  }
  
onSelect( ( @ "Inventory_Item_" player.weapons[selectedweapon].name ) );
}
function 
onItemClickedctrnxycount )
{
  
temp.= ( @ ctr );
  
temp.temp.c.weapon;
  if ( 
count == )
  {
    
onEquipctr );
  }
  else
  {
    
onSelectctr );
  }
}
function 
onItemDraggedctrlnnx)
{
  if ( ! 
this.dragging )
  {
    
startDraggingctrln );
  }
}
function 
startDraggingct )
{
  if ( ( @ 
ct ).weapon.name == NULL )
  {
    
player.chat "You can't drop this!";
    return;
  }
  
Inventory_Window.visible false;
  
this.dragging true;
  
this.dragWep = ( @ ct ).weapon;
  
Inventory_DragImg.image = ( @ ct ).weapon.image;
  
Inventory_DragQuantity.text 1;
  
refreshDrag();
  
Inventory_DragImg.visible true;
  
Inventory_DragQuantity.visible true;
  
this.startDrag timevar2;
  
client.frozen true;
}
function 
refreshDrag()
{
  
player.dir getdirmousex player.xmousey player.);
  if ( 
mousex in player.10player.10 | && mousey in player.10player.10 |)// && ( timevar2 - this.startDrag > .5 ) )
  
{
    
setAni"grab"Inventory_DragImg.image );
  }
  else
  {
    
setAni"idle""" );
  }
  
Inventory_DragImg.mousescreenx 25;
  
Inventory_DragImg.mousescreeny 25;
  
Inventory_DragQuantity.mousescreenx 30;
  
Inventory_DragQuantity.mousescreeny 20;
  
Inventory_DragImg.showtop();
}
function 
endDragging()
{
  
Inventory_Window.visible true;
  if ( 
this.dragWep.name == "Medkit" )
  {
  for (
aallplayers)
    {
      if ( 
player.x in |a.2a.2| && player.y in |a.2a.2| )
      {
        if ( 
a.account != player.account )
        {
          
triggerserver"weapon"name"revive"a.account );
          
this.dragging false;
          
Inventory_DragImg.image "";
          
Inventory_DragImg.visible true;
          
Inventory_DragQuantity.text "";
          
Inventory_DragQuantity.visible false;
          
this.dragWep "";
          
client.frozen false;
        }
      }
    }
  }
  elseif ( 
mousex in player.10player.10 | && mousey in player.10player.10 | && ( timevar2 this.startDrag .5 ) )
  {
    
triggerserver"gui"name"dropItem"this.dragWep.nameInventory_DragQuantity.textthis.dragWep.imageplayer.account );
  }
  else
  {
    
setAni"idle""" );
  }
  
this.dragging false;
  
Inventory_DragImg.image "";
  
Inventory_DragImg.visible false;
  
Inventory_DragQuantity.text "";
  
Inventory_DragQuantity.visible false;
  
this.dragWep "";
  
client.frozen false;
}

function 
onSelectctrl )
{
  
temp.= ( @ ctrl ).weapon.name;
  
temp.temp.n.tokenize"/" );
  if ( 
temp.a.size() == )
  {
    
Inventory_ItemName.text "Item:" SPC temp.a[1];
  }
  else
  {
    
Inventory_ItemName.text "Item:" SPC temp.a[0];
  }

  
Inventory_ItemQuantity.text "Quantity:" SPC clientr.item.( @ temp.);
  
Inventory_Icon.image = ( @ ctrl ).weapon.image;
}
function 
onEquipctrl3 )
{
  
temp.= ( @ ctrl3 ).weapon.name;
  for ( 
temp.0temp.player.weapons.size(); temp.++ )
  {
    
temp.player.weapons[temp.i];
    if ( 
temp.a.name == temp.)
    {
      
selectedweapon temp.i;
    }
  }



Mark Sir Link 03-15-2010 01:50 AM

use enablefeatures() and the appropriate bitflags to enable what you want


Game features (for enablefeatures)

2 P key
4 Q key
8 R key
0x10 S+A combo
0x20 S+D combo
0x40 TAB key
0x80 chat text
0x100 hearts overhead
0x200 display of nicknames
0x400 toall/PM bubbles
0x800 right-click profiles
0x1000 emoticons
0x2000 Alt+5 snapshots
0x4000 Alt+8/9 zooming
0x8000 logframe
allfeatures all features

jkldogg 03-15-2010 02:34 AM

Quote:

Originally Posted by Mark Sir Link (Post 1562604)
use enablefeatures() and the appropriate bitflags to enable what you want


Game features (for enablefeatures)

2 P key
4 Q key
8 R key
0x10 S+A combo
0x20 S+D combo
0x40 TAB key
0x80 chat text
0x100 hearts overhead
0x200 display of nicknames
0x400 toall/PM bubbles
0x800 right-click profiles
0x1000 emoticons
0x2000 Alt+5 snapshots
0x4000 Alt+8/9 zooming
0x8000 logframe
allfeatures all features

I've seen this before, can't remember where it goes though. Any help?

Imperialistic 03-15-2010 02:58 AM

Maybe you should read and learn yourself instead of asking for scripts, it's okay to ask questions for help but people giving you scripts isn't helping. If you read through all of the wiki's you should be able to answer your own questions.

Maybe these links can help you:
www.wiki.graal.us
www.wiki.graal.net
www.gs2.graalstudios.com

jkldogg 03-15-2010 03:08 AM

Quote:

Originally Posted by Imperialistic (Post 1562632)
Maybe you should read and learn yourself instead of asking for scripts, it's okay to ask questions for help but people giving you scripts isn't helping. If you read through all of the wiki's you should be able to answer your own questions.

Maybe these links can help you:
www.wiki.graal.us
www.wiki.graal.net
www.gs2.graalstudios.com

1.) No one is giving me scripts. These are scripts that people have came on my server and scripted and left them bugged.

2.) I'm not good at reading text and learning how to script..it's so many different variables and stuff..I need a video. Make one and i'll be happy.

salesman 03-15-2010 03:32 AM

Quote:

Originally Posted by jkldogg (Post 1562634)
1.) No one is giving me scripts. These are scripts that people have came on my server and scripted and left them bugged.

2.) I'm not good at reading text and learning how to script..it's so many different variables and stuff..I need a video. Make one and i'll be happy.

I think what he's trying to say is that it doesn't look like you're making an effort to learn. It seems more like you're just looking for people to give you all the answers.

fowlplay4 03-15-2010 03:41 AM

Quote:

Originally Posted by jkldogg (Post 1562634)
I'm not good at reading text and learning how to script..it's so many different variables and stuff..I need a video. Make one and i'll be happy.

You will never learn how to script if you keep this up.

You've done the following numerous times now:

1. Posted a broken script.
2. Disregarded tips and advice on how to fix it.
3. Waited till a copy-paste (same thing as giving you scripts) solution is present.
4. Made remarks about putting no effort into learning how to script.

Switch 03-15-2010 03:51 AM

Quote:

Originally Posted by jkldogg (Post 1562634)
I'm not good at reading text and learning how to script..it's so many different variables and stuff..I need a video. Make one and i'll be happy.

A nice, simple way to say things that the others couldn't:
That's mostly what scripting is. A video won't help since scripting is all text. What you'd need is a brain that can compute what you want to do and output it in a scripting language, then be able to debug it on your own through either trial/error or finding exactly what doesn't get called/set/whatever correctly, or where you may have messed up your code.

jkldogg 03-15-2010 05:03 AM

fine u w1n
 
Quote:

Originally Posted by salesman (Post 1562638)
I think what he's trying to say is that it doesn't look like you're making an effort to learn. It seems more like you're just looking for people to give you all the answers.

Quote:

Originally Posted by fowlplay4 (Post 1562639)
You will never learn how to script if you keep this up.

You've done the following numerous times now:

1. Posted a broken script.
2. Disregarded tips and advice on how to fix it.
3. Waited till a copy-paste (same thing as giving you scripts) solution is present.
4. Made remarks about putting no effort into learning how to script.

Quote:

Originally Posted by Switch (Post 1562641)
A nice, simple way to say things that the others couldn't:
That's mostly what scripting is. A video won't help since scripting is all text. What you'd need is a brain that can compute what you want to do and output it in a scripting language, then be able to debug it on your own through either trial/error or finding exactly what doesn't get called/set/whatever correctly, or where you may have messed up your code.

Thank you all for your concern. I will now begin learning to script, I found a good guide. I hope I can be as good as you guys one day. I look up to: Chris Vimes, Switch, and salesman. I view them as good scripters. (Sorry Jerret, i've never seen you script.)

http://www.gs2.graalstudios.com/index.php?page=basic


All times are GMT +2. The time now is 03:56 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.