Graalians

Graalians (https://www.graalians.com/forums/index.php)
-   Creative Corner (https://www.graalians.com/forums/forumdisplay.php?f=17)
-   -   John's Scripts (https://www.graalians.com/forums/showthread.php?t=9528)

Johnaudi 09-04-2012 12:10 AM

Thanks about this :) stupid question : break; would stop the switch();?

PerfectDark 09-04-2012 12:37 AM

Yes.(Depending on where you put it).

break; stops the whole function and would be used after every case "putcasehere": script.

Example on the useage:
PHP Code:

function onActionServerside() {
  switch (
params[0]) {
  case 
"Var1":
    {
      
player.chat "Woot I triggered this case!";
      break;
    }
  case 
"Var2":
    {
      if (
clientr.banned != NULL
    {
      
player.chat "I have been banned from using this function :(";
    } else {
      
player.chat "Woot I triggered another case, I am on fire!";
    }
    break;
  }


Hope this helps, and don't do what i did by checking if a clientr function to check if someone is banned from a function unless you have a way to prevent the flag from being altered by a memory editor, or something like that. (you already know that)

Johnaudi 09-04-2012 10:36 AM

So if I don't include break; the script would keep on running to the second case?

knuckles 09-08-2012 06:26 PM

`I have no idea what scripts are, but let me say this.... why so complicated :0?

Johnaudi 09-08-2012 08:00 PM

Quote:

Posted by knuckles (Post 194927)
`I have no idea what scripts are, but let me say this.... why so complicated :0?

I suppose those are the basics...

callimuc 09-08-2012 08:29 PM

Quote:

Posted by PerfectDark (Post 192680)
PHP Code:

function onActionServerside() {
  switch (
params[0]) {
  case 
"Var1":
    {
      
player.chat "Woot I triggered this case!";
      break;
    }
  case 
"Var2":
    {
      if (
clientr.banned != NULL
    {
      
player.chat "I have been banned from using this function :(";
    } else {
      
player.chat "Woot I triggered another case, I am on fire!";
    }
    break;
  }



that styling .____. meh

Johnaudi 09-08-2012 08:33 PM

Quote:

Posted by callimuc (Post 194993)
that styling .____. meh

Okay, so let's get back to questions...
I was looking forward for a way to script the TTS :sort thingy, I'm trying to make the players cut in half and randomly goes to different location.

Emera 09-08-2012 08:38 PM

Quote:

Posted by Johnaudi (Post 194995)
Okay, so let's get back to questions...
I was looking forward for a way to script the TTS :sort thingy, I'm trying to make the players cut in half and randomly goes to different location.

Sorting the players into 2 teams? This should work.
PHP Code:

temp.teams = {
  
"Team 1""Team "
};

for (
temp.plplayers) {
  
temp.team temp.teams[temp.count temp.teams.size()];
  
temp.count++;

  if (
temp.team == "Team 1") {
    
temp.pl.x10;
    
temp.pl.10;
  }
  elseif(
temp.team == "Team 2") {
    
temp.pl.20;
    
temp.pl.20;
  }



Tricxta 09-08-2012 09:47 PM

Quote:

Posted by callimuc (Post 194993)
that styling .____. meh

Indenting* I also like how that script uses multiple conventions as though the author can't pick which one to use. :0

Johnaudi 09-08-2012 09:56 PM

Quote:

Posted by Emera (Post 194998)
Sorting the players into 2 teams? This should work.
PHP Code:

temp.teams = {
  
"Team 1""Team "
};

for (
temp.plplayers) {
  
temp.team temp.teams[temp.count temp.teams.size()];
  
temp.count++;

  if (
temp.team == "Team 1") {
    
player.10;
    
player.10;
  }
  elseif(
temp.team == "Team 2") {
    
player.20;
    
player.20;
  }



Sorry but, 1) you didn't use temp.pl 2) I didn't quite understand the usage of
temp.team = temp.teams[temp.count % temp.teams.size()];
temp.count++;
Thanks!

Emera 09-08-2012 09:57 PM

Quote:

Posted by Johnaudi (Post 195015)
Sorry but, 1) you didn't use temp.pl 2) I didn't quite understand the usage of
temp.team = temp.teams[temp.count % temp.teams.size()];
temp.count++;
Thanks!

Oh god, my bad at #1, let me fix that for you. And that basically sorts them into 2 groups <3

Johnaudi 09-08-2012 10:00 PM

What's temp.count and what does % do xD

Tricxta 09-08-2012 10:42 PM

Quote:

Posted by Johnaudi (Post 195019)
What's temp.count and what does % do xD

% is the symbol for modular division.
It basically works but...urghh I suck at explaining it, have a wiki:http://en.wikipedia.org/wiki/Modulo_operation

But basically it's allowing the variable to pick between to the 2 teams swapping back and fourth.

temp.count=0:0%2 = element 0 = team 1
temp.count = 1:1%2 = element 1 = team 2
temp.count = 2:2%2=0 = element 0 = team 1
temp.count = 3:3%2 = 1 = element 1 = team 2
and so on. It's a really nice solution btw emera.

Emera 09-08-2012 10:59 PM

Quote:

Posted by Tricxta (Post 195039)
% is the symbol for modular division.
It basically works but...urghh I suck at explaining it, have a wiki:http://en.wikipedia.org/wiki/Modulo_operation

But basically it's allowing the variable to pick between to the 2 teams swapping back and fourth.

temp.count=0:0%2 = element 0 = team 1
temp.count = 1:1%2 = element 1 = team 2
temp.count = 2:2%2=0 = element 0 = team 1
temp.count = 3:3%2 = 1 = element 1 = team 2
and so on. It's a really nice solution btw emera.

Thanks :P And thanks for the nice explanation. Mine would've sucked.

callimuc 09-09-2012 01:50 AM

Quote:

Posted by Emera (Post 194998)
Sorting the players into 2 teams? This should work.
PHP Code:

temp.teams = {
  
"Team 1""Team "
};

for (
temp.plplayers) {
  
temp.team temp.teams[temp.count temp.teams.size()];
  
temp.count++;

  if (
temp.team == "Team 1") {
    
temp.pl.x10;
    
temp.pl.10;
  }
  elseif(
temp.team == "Team 2") {
    
temp.pl.20;
    
temp.pl.20;
  }




Quote:

Posted by Tricxta (Post 195039)
and so on. It's a really nice solution btw emera.

the only thing i dont like about it: whenever you want to randomnize it with the same players, wouldnt it keep them in the same team? at least i think so, since the players array is sorted by the account, right?

Tricxta 09-09-2012 02:20 AM

Quote:

Posted by callimuc (Post 195121)
the only thing i dont like about it: whenever you want to randomnize it with the same players, wouldnt it keep them in the same team? at least i think so, since the players array is sorted by the account, right?

I thought that as well, I was going to say something but i'm not super sure how the players are listed since everyone would have their own arrays I guess.

A way to ensure randomness would be to do something like:
PHP Code:

temp.pArr players;
temp.teams = {0,0};
temp.toggle 0;
while (
pArr.size() > 0){
  
toggle =(toggle+1)%2;
  
temp.rInd int(random(0,pArr.size());
  
temp.teams[toggle].add(pArr[rInd]);
  
pArr.remove(rInd);


But meh...

Mofujohn 09-09-2012 04:28 AM

Wish I knew what this stuff meant.

xXziroXx 09-09-2012 10:11 PM

PHP Code:

function onCreated()
{
  
// -- START EDIT
  
temp.objectList    allplayers// List of players to process
  
temp.numberOfTeams 2// Number of teams
  // -- END EDIT
  
  
temp.playerList = new[0];
  
// Generates a new list of objects we can work with
  
for (temp.objecttemp.objectList) {
    
// Let's avoid adding those silly RemoteControls
    
if (temp.object.level.name != "")
      continue;
    
    
temp.playerList.add(temp.object);
  }
  
  
// Amount of players
  
temp.amountOfPlayers temp.playerList.size();
  
// Array creation based on number of teams
  
temp.teams           = new[temp.numberOfTeams];
  
temp.team            0;
  
  
// Do we have enough players to make even teams?
  
if (temp.amountOfPlayers%temp.numberOfTeams)
    
temp.oddManOut true;
  
  
// Let's add players to the teams!
  
while (!temp.teamsGenerated) {
    
// Grab a random player from the list...
    
temp.object      randomString(temp.playerList);
    
temp.objectIndex temp.playerList.index(temp.object);
    
    
// Abort if an object wasn't found anymore
    
if (temp.objectIndex == -1)
      return echo(
"[" this.name "]: Index of object returned -1!");
    
    
// Add the player to the team array
    
temp.teams[temp.team].add(temp.object);
    
// Remove the player from the player list
    
temp.playerList.delete(temp.objectIndex);
    
    echo(
"[" this.name "]: Added '" temp.object "' to team '" temp.team "'!");
    
    
// Based on how many players are left, we may stop now.
    
temp.remainingPlayers temp.playerList.size();
    if (
temp.remainingPlayers == 0)
      break;
    else if (
temp.remainingPlayers == temp.numberOfTeams && temp.oddManOut)
      break;
    
    
// If we do have more players to work with, change the team for the next one.
    
temp.team ++;
    
temp.team %= temp.numberOfTeams;
  }
  
  echo(
"[" this.name "]: All" SPC temp.numberOfTeams SPC "teams sorted evenly!" SPC temp.remainingPlayers SPC "player(s) were left out" SPC (temp.remainingPlayers ":(" ":)"));


:p


Quote:

Posted by Tricxta (Post 195137)
I thought that as well, I was going to say something but i'm not super sure how the players are listed since everyone would have their own arrays I guess.

A way to ensure randomness would be to do something like:
PHP Code:

temp.pArr players;
temp.teams = {0,0};
temp.toggle 0;
while (
pArr.size() > 0){
  
toggle =(toggle+1)%2;
  
temp.rInd int(random(0,pArr.size());
  
temp.teams[toggle].add(pArr[rInd]);
  
pArr.remove(rInd);


But meh...

Please, oh -PLEASE-, start naming your variables more logically. Stuff like "pArr" and "rInd" might make sense at the time of making, but when looking back at code you'll quickly come to realize how stupid you were by naming it that. It also makes it hard for anyone else to figure out what your code actually does.

Tricxta 09-09-2012 10:36 PM

Quote:

Posted by xXziroXx (Post 195557)
Please, oh -PLEASE-, start naming your variables more logically. Stuff like "pArr" and "rInd" might make sense at the time of making, but when looking back at code you'll quickly come to realize how stupid you were by naming it that. It also makes it hard for anyone else to figure out what your code actually does.

My code's so good, I never have to look back at it anyway. Besides i'm use to gs1 coding where the variable name in a client string actually counts towards the character limit.Besides, if I hadn't been so half assed, I would usually leave comments.

You don't got **** me on me ;o

xXziroXx 09-09-2012 10:41 PM

Quote:

Posted by Tricxta (Post 195562)
My code's so good, I never have to look back at it anyway. Besides i'm use to gs1 coding where the variable name in a client string actually counts towards the character limit.Besides, if I hadn't been so half assed, I would usually leave comments.

You don't got **** me on me ;o

Being used to doing something in one way is a poor excuse for not needing to change. There's no need to be so defensive, I was trying to give you some pointers, that's all. John is trying to learn GScript, if you should ever lead by a good example, this is as good of a time as it gets.

Tricxta 09-09-2012 10:53 PM

Quote:

Posted by xXziroXx (Post 195563)
Being used to doing something in one way is a poor excuse for not needing to change. There's no need to be so defensive, I was trying to give you some pointers, that's all. John is trying to learn GScript, if you should ever lead by a good example, this is as good of a time as it gets.

I was demonstrating a method, not good coding conventions. But yer, you have your valid points. Keep up the good work master c0dur.

Johnaudi 09-10-2012 06:39 AM

Thanks guys :)
Now I simply want to know, what's the usage of "?"...
Like 3 ? 2 = ?
Just wanted to learn that as I see it in several scripts.

Tricxta 09-10-2012 10:02 AM

Quote:

Posted by Johnaudi (Post 195767)
Thanks guys :)
Now I simply want to know, what's the usage of "?"...
Like 3 ? 2 = ?
Just wanted to learn that as I see it in several scripts.

It's a conditional statement.
PHP Code:

variable = (condition)?x:y

is equivalent to
PHP Code:

if (condtion)
  
variable x;
else
  
variable y

Some people think they're pretty ugly. I only use them if it's a small statement otherwise I stretch it out for viewing purposes. Also makes debugging that much easier.

callimuc 09-10-2012 07:50 PM

another example (just have to put my contribution :P)

PHP Code:

temp.flag true;
player.chat "The statement is: " @ (temp.flag "true :D" "false :("); 


Johnaudi 09-10-2012 09:09 PM

I don't exactly get it since, let's say we have :
temp.var = 5;
player.chat = "Number"SPC (temp.var ? "is correct" : "is false");

I don't see how they can know that it's "if (temp.var == 5)" or not == 4. Is it used for booleans only? (true / false)?

xXziroXx 09-10-2012 10:07 PM

Quote:

Posted by Johnaudi (Post 195962)
I don't exactly get it since, let's say we have :
temp.var = 5;
player.chat = "Number"SPC (temp.var ? "is correct" : "is false");

I don't see how they can know that it's "if (temp.var == 5)" or not == 4. Is it used for booleans only? (true / false)?

In your case, you'd do (temp.var == 5 ? "is correct" : "is false")

callimuc 09-10-2012 11:28 PM

Quote:

Posted by Johnaudi (Post 195962)
I don't exactly get it since, let's say we have :
temp.var = 5;
player.chat = "Number"SPC (temp.var ? "is correct" : "is false");

I don't see how they can know that it's "if (temp.var == 5)" or not == 4. Is it used for booleans only? (true / false)?

as tricxta said, its
PHP Code:

(condition condition_true condition_false); 

just like
PHP Code:

if (condition) {
  
condition_is_true_stuff;
}
else {
  
condition_is_false_stuff;


the condition can be just like in if() checks. so you can go from if (something_is_true/false) ...., if (something == something else) ...., if (something != something else) ...., ... . its good to use the ? if you got short checks or want to call functions, like

PHP Code:

temp.number 5;
player.chat "the number is 5? " @ (temp.number == "yes!" "no!");

//instead of

temp.number 5;
if (
temp.number == 5player.chat "the number is 5? yes!";
else 
player.chat "the number is 5? no!"



//or



temp.invalid_speed true;
temp.invalid_speed speedFix() : anotherFunction();

//instead of

temp.invalid_speed true;
if (
temp.invalid_speedspeedFix();
else 
anotherFunction(); 


Johnaudi 09-11-2012 07:35 AM

Quote:

Posted by xXziroXx (Post 195986)
In your case, you'd do (temp.var == 5 ? "is correct" : "is false")

Cleared everything up you and Callimuc :) thanks again.
hm so let's see what's left to know, anyone got an idea?

callimuc 09-11-2012 06:03 PM

best way is to test around, look at other scripts and so on

Johnaudi 09-11-2012 07:57 PM

Oh yes, vecx and vecy please, I didn't get a clue of what they are about. Thanks!

Emera 09-11-2012 08:10 PM

If you're up for a spot of reading, Tigairius made an in-depth explanation on vecx and vecy on the official forums. You should check it out.

Johnaudi 09-11-2012 09:55 PM

Thanks @ Emera, understood it, but how exactly and where to use it :/

xXziroXx 09-12-2012 02:13 AM

If you have a PC account that has had Gold at least once, I highly recommend that you register on those forums with it. The scripting help you can get there is likely to be overwhelmingly more (and arguably better) than here.

Emera 09-12-2012 08:03 AM

Quote:

Posted by xXziroXx (Post 196557)
If you have a PC account that has had Gold at least once, I highly recommend that you register on those forums with it. The scripting help you can get there is likely to be overwhelmingly more (and arguably better) than here.

Ziro's right. As much as we'd all love to help you, there's only so far we can go. I'm not the best of scripters, and there's going to be a point sooner or later where I'm going to start struggling answering your questions, and the few who are helping you won't be far behind me on that one. If you're unable to buy gold yourself, I'll happily buy you a month of it so you're able to sign up to those forums.

Jester Lapse 09-12-2012 09:00 AM

Quote:

Posted by Emera (Post 196688)

Ziro's right. As much as we'd all love to help you, there's only so far we can go. I'm not the best of scripters, and there's going to be a point sooner or later where I'm going to start struggling answering your questions, and the few who are helping you won't be far behind me on that one. If you're unable to buy gold yourself, I'll happily buy you a month of it so you're able to sign up to those forums.

He works iEra so he gets free gold. Pay for mine nub <3_<3

Johnaudi 09-12-2012 11:08 AM

Quote:

Posted by Emera (Post 196688)
I'll happily buy you a month of it so you're able to sign up to those forums.

okay sure, I'll tell snk not giving me Gelats this month. Lol jk thanks for the offer but nah, I suppose Graal's official forums are dead and rare are the people who still go there.,,

xXziroXx 09-12-2012 12:36 PM

Quote:

Posted by Johnaudi (Post 196707)
Graal's official forums are dead and rare are the people who still go there.,,

This is not true at all, and is a common misconception by the people who use Graalians.

Johnaudi 09-18-2012 07:45 AM

Alright so another thing, is there a way to get a list of all players in a guild? I did try
PHP Code:

for (temp.iallplayers) {
  if (
temp.== "Guild") {
    
temp.findplayerbycommunityname(temp.i);
    echo(
temp.a);
  }


It's just giving me one member with the tag on... Any other ideas how I can set them in an array?

Kavan 09-18-2012 04:29 PM

Quote:

Posted by Johnaudi (Post 200237)
Alright so another thing, is there a way to get a list of all players in a guild? I did try
PHP Code:

for (temp.iallplayers) {
  if (
temp.== "Guild") {
    
temp.findplayerbycommunityname(temp.i);
    echo(
temp.a);
  }


It's just giving me one member with the tag on... Any other ideas how I can set them in an array?

PHP Code:

for(temp.pl allplayers) {
  if(
temp.pl == "Guild" && temp.pl.level != NULL) {
    
temp.array[temp.playerCount] = findPlayerByCommunityName(temp.pl);
    
temp.playerCount ++;
  }
}
echo(
temp.array); 

Hopefully that should work as intended.

Tricxta 09-19-2012 02:20 AM

I really don't get you guys, you're saying is this player object equivalent to "guild"

it should be:
PHP Code:

for (temp.pl allplayers){
  if (
temp.pl.guild == "guild" && temp.pl.level != NULL){
    
temp.array[temp.playerCount] = findPlayerByCommunityName(temp.pl); 
    
temp.playerCount ++; 
  }



Johnaudi 09-19-2012 07:29 AM

Difference? "guild" was just an example - thanks guys :)

Johnaudi 09-19-2012 09:22 PM

Alright, so today I asked snk how do player.onHP() work... I got the major idea about it, I am still wondering of: how do they set the params about it? Let's say player.onHP(-50); would they have something like if (params[0] == "-50") or is there another way?

callimuc 09-19-2012 09:44 PM

Quote:

Posted by Johnaudi (Post 201045)
Alright, so today I asked snk how do player.onHP() work... I got the major idea about it, I am still wondering of: how do they set the params about it? Let's say player.onHP(-50); would they have something like if (params[0] == "-50") or is there another way?

you should keep custom commands from iEra intern. anyway, lets say you have something like

PHP Code:

onDoDamage(50); 

than you could remove the damage (depending on the system you use) like this
PHP Code:

public function onDoDamage(dmg) {
  if (
clientr.health_cur == 0) return;
  
temp.damage max(dmg0); //use max() to avoid positive damage (healing)
  
if (clientr.health_cur damage 0clientr.health_cur -= damage;
  else if (
clientr.health_cur dmg >= 0) {
    
clientr.health_cur 0;
    
onRevivePlayer();
  }
}

function 
onRevivePlayer() {
  
//add a revive gani or whatever you want to have
  
clientr.health clientr.health_max;


and to add damage you would simply use such a function
PHP Code:

public function onAddDamage(dmg) {
  if (
clientr.health_cur == clientr.health_max) return;
  
clientr.health_cur min(clientr.health_maxclientr.health_cur+dmg); //use min() to avoid negative damage


you can also change it so you can add and remove damage within one function. that could look like
PHP Code:

onDamage(somedamagehere);

function 
onDamage(dmg) {
  
clientr.health_cur -= dmg;
  
/*
  in case you are not that familiar with maths:
  if the dmg is positive, its adding the damage (hurt) with the -
  but if the damage is negative, its returning in the "negative and negative = positive" rule in maths
  */
  
if (clientr.health_cur clientr.health_maxclientr.health_cur clientr.health_max;
  else if (
clientr.health_cur =< 0onRevivePlayer();
}

function 
onRevivePlayer() {
  
//add some stuff like a revive gani or whatever you want to have
  
clientr.health_cur clientr.health_max;



this is pretty barebone. you would be on your best way by joining the player to a class so you can call the functions with player.yourFunction() rather than with triggering the server or any other stuff.

Johnaudi 09-30-2012 06:40 AM

Okay thanks guys, another thing. I have made 2 scripts with findimg() and I want them both in the same Weapon, any way to do that?

Tricxta 09-30-2012 06:42 AM

Quote:

Posted by Johnaudi (Post 206362)
Okay thanks guys, another thing. I have made 2 scripts with findimg() and I want them both in the same Weapon, any way to do that?

uhmm what?

Johnaudi 09-30-2012 06:52 AM

So okay, I got those two scripts :
PHP Code:

function onActionServerSide() {
  if (
params[0] == "mouse") {
    
temp.ix params[1];
    
temp.iy params[2];
    for (
temp.allplayers) {
      if (
temp.ix in |temp.p.1temp.p.3| && temp.iy in |temp.p.ytemp.p.3|) {
        
temp.p.chat "I've been shot!";
        
temp.p.onHP(-9);
      }
    }
  }
}
//#CLIENTSIDE
function onCreated() {
  
thiso."iera-callimuc_sniper-crosshair.png";
  
thiso.32;
}
function 
onPlayerChats() {
  if (
player.chat == "rooton") {
    
thiso.bool true;
    
setTimer(0.1);
  }
  if (
player.chat == "rootoff") {
    
thiso.bool false;
    
setTimer(0.01);
  }
}
function 
onMouseDown(mode) {
  if (
mode == "right") {
    if (
thiso.bool true)
      
triggerserver("gui"name"mouse",mousex,mousey);
  }
}
function 
onTimeOut() {
  
with (findimg(199)) {
    
image = (thiso.boolthiso."");
    
mousex 1.40;
    
mousey 1.40;
    if (
mousex player.x) {
      
thiso.= (mousex - (player.1)) / thiso.q;
    } else
    if (
mousex player.x) {
      
thiso.= (+ (player.1) - mousex) / thiso.q;
    }
    if (
mousey player.y) {
      
thiso.= (mousey - (player.1)) / thiso.q;
    } else
    if (
mousey player.y) {
      
thiso.= (+ (player.1) - mousey) / thiso.q;
    }
    
zoom  = ((thiso.thiso.u) >= ? (thiso.thiso.u) = : (thiso.thiso.u));
    
layer 3;
    
spin  = -3;
  }
  
setTimer(random(0.01,0.04));


PHP Code:

//#CLIENTSIDE
function onCreated() {
  
thiso."iera-callimuc_sniper-crosshair.png";
  
thiso.15;
}
function 
onPlayerChats() {
  if (
player.chat == "rooton") {
    
thiso.bool true;
    
setTimer(0.1);
  }
  if (
player.chat == "rootoff") {
    
thiso.bool false;
    
setTimer(0.01);
  }
}
function 
onTimeOut() {
  
with (findimg(199)) {
    
image = (thiso.boolthiso."");
    
mousex 1.40;
    
mousey 1.40;
    if (
mousex player.x) {
      
thiso.= (mousex - (player.1)) / thiso.q;
    } else
    if (
mousex player.x) {
      
thiso.= (+ (player.1) - mousex) / thiso.q;
    }
    if (
mousey player.y) {
      
thiso.= (mousey - (player.1)) / thiso.q;
    } else
    if (
mousey player.y) {
      
thiso.= (+ (player.1) - mousey) / thiso.q;
    }
    
zoom  = ((thiso.thiso.u) >= ? (thiso.thiso.u) = : (thiso.thiso.u));
    
layer 3;
    
spin  2;
  }
  
setTimer(random(0.01,0.04));


is there a way to match them in one?

Oh and if there is any way to make the player's dir follow the mouse coordinates would help too :(
Can't seem to make them change on both X and Y.

Tricxta 09-30-2012 07:54 AM

Okay so you'll just have to copy and paste things into one weapon while watching out for clashes in indexes and variable names, bit of a no brainer tbh...

Also with having the player direction follow your mouse you could just do:
PHP Code:

player.dir = (int((pi*2-getangle(mousex-player.x,player.y-mousey)+(pi/4))/(pi/2))+3)%4

and place it in a timeout loop.

There was a function that works that out as well but I can never remember it...

Johnaudi 09-30-2012 08:04 AM

will there be a difference with
PHP Code:

player.dir getdir(mousex player.1.5mousey player.1.5); 

and yours? Pix just told me about it

Tricxta 09-30-2012 08:48 AM

Quote:

Posted by Johnaudi (Post 206394)
will there be a difference with
PHP Code:

player.dir getdir(mousex player.1.5mousey player.1.5); 

and yours? Pix just told me about it

Yer, there'll be no difference. I just can't remember that function since I use gs1 mostly.

callimuc 09-30-2012 12:58 PM

Quote:

Posted by Johnaudi (Post 206368)
-scripts-

why did you use thiso.flags?

you only have to use it outside of the with() function if you are regarding it to a this.flag outside of the with() function. like

PHP Code:

function onCreated() {
  
this.whatever "hi";
  
with(findPlayer("callimuc")) {
    
chat thiso.whatever;
    
nick thiso.whatever;
  }


this.flag inside the with() function would attribute to the stuff inside the with() function (in this case the findPlayer("callimuc")


ps: what kind of sniper are you trying to do o.O just looks like a random crosshair being shown somewhere with a laggy player check :P


All times are GMT. The time now is 12:19 PM.

Powered by vBulletin/Copyright ©2000 - 2025, vBulletin Solutions Inc.