Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Gun script working !! (https://forums.graalonline.com/forums/showthread.php?t=84492)

GULTHEX 03-04-2009 12:05 AM

Gun script working !!
 
DONT NAG ME ABOUT PARAMQUALS IT STILL Works

i can script

PHP Code:

//SCRIPTED BY GULTHEX B****ES
//DONT NAG ME ABOUT PARAMQUALS
//BECAUSE IT WORKS 
//#CLIENTSIDE
//up
if (playerdir=0){
  
this.x=playerx-1;
  
this.y=playery-2;
}
//left
if (playerdir=1){
  
this.x=playerx-2;
  
this.y=playery;
}
//down
if (playerdir=2){
  
this.x=playerx+1;
  
this.y=playery+2;
}
//right
if (playerdir=3){
  
this.x=playerx+2;
  
this.y=playery;
}
}

if (
weaponfired){
  
setshootparams PARAMEQUALS;
  
//shoot x,y,z,angle,zangle,power,gani,ganiparams;
  
shoot this.x,this.y,playerz,(playerdir 1) * pi 2,,,bullet gani here,;
  
setani firing motion here,;
  
replaceani idle,standing still motion here;
  
replaceani walk,walking motion here;
  
freezeplayer 0.0383;
  
sleep 0.1;
}
if (
actionprojectile) {
  if(
strequals(#p(index),PARAMEQUALS)) {
    
hurt 3;
  }


TOLD YOU I COULD MAKE ME 1


NOW DONT TREAT ME LIKE S#1t
got that!

note post a reply if you need help with it

like where to put it lol

Tigairius 03-04-2009 03:21 AM

ok, but you shouldn't use toweapons anymore unless you're only practicing offline.

Online this could be accomplished like so:
PHP Code:

//#CLIENTSIDE
function onWeaponFired() {
  
shoot(player.1.5 vecx(player.dir), player.vecy(player.dir), player.z, (playerdir 1) * pi 2NULLNULL"dg_bullet"NULL);
  
setani("dg_m16-fire"NULL);
  
freezeplayer(0.25);
}

function 
onActionProjectile() {
  
player.hearts -= 3;


Cheers.

Twinny 03-04-2009 04:48 AM

gs1 is deprecated and highly inefficient: you should take the time to convert your script to GS2.

You should place the tests for player directions inside the if (weaponfired) condition otherwise each time anything happens, every single condition in the code must be tested and that is highly inefficient (ultimately, player direction should be done inside a weaponfired function). You should also use if->elseif->else otherwise each condition must be interpreted as well <- further inefficieny and it looks really poor.

PHP Code:

//The power of nesting!
// Far more efficient then 5 conditional checks right after each other
if (weaponfired)
{
  if (
condition1)
  {
    
//stuff
  
}
  else if (
condition2)
    
//stuff
  
}
  else
  {
    
//stuff
  
}


You should provide the gani you referenced.

With your attitude and attacks on forum members, you will continue to be treated like ****. You brought in a script you didn't even understand, abused members until they fixed it for you then dumped it here as if it were golden. Grow up.

Codein 03-04-2009 01:39 PM

Also, you're using the assignment operator for comparisons. Instead of using '=' to compare, use '=='.

GULTHEX 03-04-2009 10:58 PM

Okay I will note that.

K I just dont know much gs2

because I played graal when gs1 was the main scripting language.
And also my scripting teacher only knew gs1 so lol.

Codein 03-04-2009 11:27 PM

Quote:

Originally Posted by GULTHEX (Post 1471435)
Okay I will note that.

K I just dont know much gs2

because I played graal when gs1 was the main scripting language.
And also my scripting teacher only knew gs1 so lol.

I thought nobody taught you? :asleep:

Anyway, please make the effort to learn GS2.

Deas_Voice 03-05-2009 04:03 PM

i think there have been alot of GS1 around the newbie scripters, they learn GS1 instead of GS2 because of the level editor and the un-updated wiki.

Codein 03-05-2009 04:05 PM

Quote:

Originally Posted by Deas_Voice (Post 1471593)
i think there have been alot of GS1 around the newbie scripters, they learn GS1 instead of GS2 because of the level editor and the un-updated wiki.

I don't think that's an excuse anymore now there's the Testbed server.

cbk1994 03-05-2009 11:12 PM

Someone (Global Scripting Team???) needs to go through the most important pages on the wiki (e.g. "Serverside Functions") and just write in a description for all the commands & their parameters. I know someone else could do it, but most scripters are generally too busy. What is it that the GST does, anyway? I certainly don't see them out on servers helping people much.

Tigairius 03-05-2009 11:23 PM

Quote:

Originally Posted by cbk1994 (Post 1471661)
Someone (Global Scripting Team???) needs to go through the most important pages on the wiki (e.g. "Serverside Functions") and just write in a description for all the commands & their parameters. I know someone else could do it, but most scripters are generally too busy. What is it that the GST does, anyway? I certainly don't see them out on servers helping people much.

It's a wiki. Do it yourself.

Tolnaftate2004 03-06-2009 12:34 AM

Quote:

Originally Posted by cbk1994 (Post 1471661)
I certainly don't see them out on servers helping people much.

Because it's just Skyld now?

Vulgar 03-06-2009 12:36 AM

Quote:

Originally Posted by Tolnaftate2004 (Post 1471693)
Because it's just Skyld now?

Quitter

GULTHEX 03-06-2009 01:27 AM

okay.........

your insulting me even known i posted somthing helpful to alot of people


so ummmm
lol

lol everybody hates me even when im helping people

everybody needs some help with a gun server

and im trying to learn gs2

so please stop insulting me


atleast im not begging for scripts


after my ban was over i learned

im older now i was like 10 when i posted all those old scripts


so iv tried to learn how to script better

and stop insutlting me once again


your insulting mebecause of the past


dont post on my stuff if your just gona insult me

Tolnaftate2004 03-06-2009 01:30 AM

Quote:

Originally Posted by Vulgar (Post 1471695)
Quitter

I didn't quit... :(

cbk1994 03-06-2009 03:19 AM

Quote:

Originally Posted by Tigairius (Post 1471671)
It's a wiki. Do it yourself.

Good idea. On top of me paying to develop their game, why don't I also update their documentation so I can continue to develop their game?

I don't have the time to go through the wiki and update all the functions. Isn't this why the GST was formed?


All times are GMT +2. The time now is 09:15 AM.

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