![]() |
Thanks about this :) stupid question : break; would stop the switch();?
|
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:
|
So if I don't include break; the script would keep on running to the second case?
|
`I have no idea what scripts are, but let me say this.... why so complicated :0?
|
Quote:
|
Quote:
|
Quote:
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. |
Quote:
PHP Code:
|
Quote:
|
Quote:
temp.team = temp.teams[temp.count % temp.teams.size()]; temp.count++; Thanks! |
Quote:
|
What's temp.count and what does % do xD
|
Quote:
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. |
Quote:
|
Quote:
Quote:
|
Quote:
A way to ensure randomness would be to do something like: PHP Code:
|
Wish I knew what this stuff meant.
|
PHP Code:
Quote:
|
Quote:
You don't got **** me on me ;o |
Quote:
|
Quote:
|
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. |
Quote:
PHP Code:
PHP Code:
|
another example (just have to put my contribution :P)
PHP Code:
|
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)? |
Quote:
|
Quote:
PHP Code:
PHP Code:
PHP Code:
|
Quote:
hm so let's see what's left to know, anyone got an idea? |
best way is to test around, look at other scripts and so on
|
Oh yes, vecx and vecy please, I didn't get a clue of what they are about. Thanks!
|
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.
|
Thanks @ Emera, understood it, but how exactly and where to use it :/
|
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.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Alright so another thing, is there a way to get a list of all players in a guild? I did try
PHP Code:
|
Quote:
PHP Code:
|
I really don't get you guys, you're saying is this player object equivalent to "guild"
it should be: PHP Code:
|
Difference? "guild" was just an example - thanks guys :)
|
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?
|
Quote:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
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. |
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?
|
Quote:
|
So okay, I got those two scripts :
PHP Code:
PHP Code:
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. |
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:
There was a function that works that out as well but I can never remember it... |
will there be a difference with
PHP Code:
|
Quote:
|
Quote:
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:
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.