Author Topic: CommandCrate (Re named from CommandBox)  (Read 8474 times)

0 Members and 1 Guest are viewing this topic.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
CommandCrate (Re named from CommandBox)
« on: October 23, 2007, 11:20:46 pm »
After much thought, Re-Scripting, and debugging I have decided to release my "OnCommand" script with a more catchy (sorry fistbox, mine is a "box" too) name

Script Name: CommandCrate
Script Description: Contains my /create, /spawn, /force, /damage, /move, /active*, /kills*, and /mega scripts&commands (* = new command) I'm hoping these will be added to servers soon, as the commands are fun (if you are an admin ;) )
Original Author(s): Me!!! help from Toumaz in debugging, Re-Scripted by me (the file(s) used to be bigger, now all commands are in one script and is as compact as I can make it)
Core Version: 2.6.3 ??
Code:
Quote from: "Readme.txt'
Commands are as follows:

/create
params:
[pnum] (player number to create bullet at)
[xoff] (x axis offset -# = left, +# = right)
[yoff] (y axis offset -# = up, +# = down)
[xvel] (x velocity -# = left, +# = right)
[yvel] (y velocity -# = up, +# = down)
[hitm] (hit multiplier)
[type] (bullet type)
[owns] (owner of bullet)

command syntax example:
/create 1 0 0 3 -5 100 4 1 (creates a m79 nade at player 1's location with no offsets, going up and right (player 1 ownes bullet))

/spawn
params:
[wnum] (object number to spawn)
[pnum] (player number to spawn object at)
[xoff] (x offset)
[yoff] (y offset)

command syntax example:
/spawn 5 1 0 0 (spawns spas 12 @ player 1's location(no offsets))

/force
params:
[pnum] (player number who's weaps to force)
[prim] (primary weapon)
[secd] (secondary weapon)
[ammo] (Ammo to give, 0 is default)

command syntax example:
/force 1 10 5 0 (forces player1 to have minigun as primary and spas 12 as secondary with default ammo)

/dodamage
params:
[pnum] (player to damage)
[dmgi] (damage integer)

command syntax example:
/dodamage 1 150 ("Perfect kill"'s player 1 (perfect kill is 150 damage, that's the minimal damage to kill a player in DoDamage))

/move
params:
[pnum] (player to move)
[tnum] (player to move to)
[xoff] (x offset)
[yoff] (y offset)

command syntax example:
/move 1 2 0 0 (moves player 1 to player 2 (no offsets)

/kills
params:
[pnum] (player who's kills to set)
[kills] (new kills amount)

command syntax example:
/kills 1 5 (set's player 1's kills to 5)

/active (might change to /toggle)
params:
[pnum] (player whos weap to toggle)
[wnum] (weapon to toggle)
[optn] (true for on or false for off)

command syntax example:
/active 1 5 false (sets player 1's spas to off in weap menu)

/mega
params:
[script] (script to use on all players)
[script params] (script's params)

command syntax examples:
/mega move 1 0 0 (moves all players to player 1 (no offsets))
/mega spawn 5 0 0 (spawns spas 12 at all players feet (no offsets))
/mega active 1 false (turns deagles off for all players)

full list:
/create (params)
/spawn (params)
/force (params)
/dodamage (params)
/move (params)
/kills (params)
/active (params)
/mega (params)

(attached)

  • Fixed spawnin problems, mostly fixed crap, added a couple o /help stuffs...
« Last Edit: October 30, 2007, 09:46:38 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: CommandBox
« Reply #1 on: October 24, 2007, 06:13:17 am »
Hey, kavakumari? the commands are a little bit hard to understand, but i think i get them ;)
This looks very fun, i think i mite try it sometime on my server (its not very popular tho, but i can try)
i think i mite try to change it some commands work for all players, ya know???

EDIT: it looks REALLY FUN now that i look at it lol

Suggestions:
you could make every player be able to do, like i mentioned, ;)
you could make a /commands so that people could see the commands
you could add a /wepnums so thatyou could see what the numbers are
you could add a  /playernums so that you could see what the player numbers are
ill add more, but i cant right now, cause i got somone on my lap... litterally... no.. really... he's on my lap rite now... it makes it hard to type LOLZ

RE EDIT: im adding more now
« Last Edit: October 24, 2007, 02:09:59 pm by 1221995 »

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: CommandBox
« Reply #2 on: October 24, 2007, 07:45:28 am »
(sorry fistbox, mine is a "box" too)
Original name and concept, eh >:|

Wish I could say good job, but considering how messy and bloated the code is, I think you still have a few ways to go before that's justified.

Few thoughts:

  • Use proper and more efficient variable declarations instead of loads of global variants
  • You'd preferably want exception handling to tell the player he's messing stuff up
  • Read up on the case statement and use that instead of the myriads of if:s
  • Your code indentation is fugly, to say the least
  • Loops whose only intention is to handle players are better off with the iteration variable as a byte, seeing as it's a bit more memory efficient
  • There's no point in storing wether or not a player is active in an array, seeing as you could simply do GetPlayerStat(ID,'active') directly

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: CommandBox
« Reply #3 on: October 24, 2007, 12:51:05 pm »
Quote from: suggestion 1 (1221995)
Suggestions:
you could make every player be able to do, like i mentioned, ;)
if you must... (OnCommand changes to OnPlayerCommand)

Quote from: suggestion 2 (1221995)
you could make a /commands so that people could see the commands
I'll work on it (prolly a /help [script] comand in-game too)

Quote from: suggestion 3&4 (1221995)
you could add a /wepnums so thatyou could see what the numbers are
you could add a /playernums so that you could see what the player numbers are
/weapnums: I'll get right on it (day after tomorro, I lost two days worth of computer time posting this script, I have to live off school comps for 2 days)
/playernums: when commanding (/) press F1 (score menu) and it shows player nums

Quote from: Angry Toumaz
Quote from: Kavukamari
(sorry fistbox, mine is a "box" too)
Original name and concept, eh >:|
I'll change the name to CommandCrate, ok? better? (not much change)

Quote from: Toumaz
Few thoughts:

Use proper and more efficient variable declarations instead of loads of global variants

suggestions? should I array my temps instead?

Quote
You'd preferably want exception handling to tell the player he's messing stuff up
I thought I covered everything :/

Quote
Read up on the case statement and use that instead of the myriads of if's
I'll search...

Quote
Your code indentation is fugly, to say the least
O.o what's wrong T_T I add more double spaces after new begins

Quote
Loops whose only intention is to handle players are better off with the iteration variable as a byte, seeing as it's a bit more memory efficient
will change

Quote
There's no point in storing wether or not a player is active in an array, seeing as you could simply do GetPlayerStat(ID,'active') directly
arraying it lessens code size (even by a little) I like it this way...

I'll fix problems when I'm on the comp again
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: CommandBox
« Reply #4 on: October 24, 2007, 02:27:45 pm »
Suggestions cont.:
--how about a name like Com-Play, Complay or command play(those prolly stink, im just making random suggestions lol :P ) ? Maybe somthing like Free-command. you could also do something that sounds cool  like F15 or XQ9. lol
--im not sure wether u hav it already, but if not, how about a /tele (and, optionaly, a /mapcoords). /mapcoords would put u in spec mode, but tell u wat the coords are whereever ur mouse is (im like 90 percent sure thats impossible, but o well, just a suggestion) :P
--this would be cheap if it could be used by anyone, but only used by admins, it could be cool. Im thinking a /spawnset that would let u choose were u wanna respawn every time. typeing /spawnset current or someting would make u respawn in the place u just wer. This would just be fun to hav.
-- lastly, (sorry toumaz, its just such a cool concept) a /godmode on/off command.
Ill add even more later.


EDIT:  thought of some...
-- a /jam command that jams a certain player numbers gun. /unjam could also be used the same way. (by jam, i mean the reload bar stays in the same place and if is reloded, wont shoot.
-- a /jamwep command that jams a certain GUN of all players. lets say 2 people have m79s.
/jamwep 7 makes both of their guns jam. that way u can temp deactivate guns while people still hav them. /unjam could also be used the same way.
-- also, u could try to make commands a lil simpler ;)
« Last Edit: October 24, 2007, 02:40:47 pm by 1221995 »

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: CommandBox
« Reply #5 on: October 24, 2007, 03:09:19 pm »
Quote from: suggestions (1221995)
Suggestions cont.:
--how about a name like Com-Play, Complay or command play(those prolly stink, im just making random suggestions lol :P ) ? Maybe somthing like Free-command. you could also do something that sounds cool  like F15 or XQ9. lol
--im not sure wether u hav it already, but if not, how about a /tele (and, optionaly, a /mapcoords). /mapcoords would put u in spec mode, but tell u wat the coords are whereever ur mouse is (im like 90 percent sure thats impossible, but o well, just a suggestion) :P
--this would be cheap if it could be used by anyone, but only used by admins, it could be cool. Im thinking a /spawnset that would let u choose were u wanna respawn every time. typeing /spawnset current or someting would make u respawn in the place u just wer. This would just be fun to hav.
-- lastly, (sorry toumaz, its just such a cool concept) a /godmode on/off command.
-- a /jam command that jams a certain player numbers gun. /unjam could also be used the same way. (by jam, i mean the reload bar stays in the same place and if is reloded, wont shoot.
-- a /jamwep command that jams a certain GUN of all players. lets say 2 people have m79s.
/jamwep 7 makes both of their guns jam. that way u can temp deactivate guns while people still hav them. /unjam could also be used the same way.
-- also, u could try to make commands a lil simpler ;)

Name: will change to CommandCrate or Free-Sol or something. just be glad I didn't stick with "God-minBox" :X (that was original name)
/tele: I will add a /pos command and a /tele 1/2/3 or something (/tele 1 save, /tele 1 load)
/spawnset: I think I will add this, and maybe make seperate arrays of spawn points for each player
/god: I will add this, but I will have a diff way then fistbox (OnPlayerDamage Result:=0) (hey toumaz, does result in onplayerdamage change damage done?)
/jam: I don't think this is possible, unless you use a forceweapon loop in apponidle
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: CommandBox
« Reply #6 on: October 24, 2007, 03:21:57 pm »
ok. ill think up somemore soon ;)

Diss

  • Guest
Re: CommandBox
« Reply #7 on: October 24, 2007, 05:10:56 pm »
Soldat must hate me as it won't work :(
It says the script loaded but I tried them all and nothing happened :S

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: CommandBox
« Reply #8 on: October 24, 2007, 05:15:21 pm »
Soldat must hate me as it won't work :(
It says the script loaded but I tried them all and nothing happened :S
make sure ur admin ^^

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: CommandBox
« Reply #9 on: October 24, 2007, 05:26:34 pm »
ToDoList:

  • Change Script Name
  • Add /help Script
  • More efficiant variables
  • fix un-needed stuffs
  • add /pos and /tele scripts
  • Add /spawnset
  • Add /god
  • try /jam
  • wait for Toumaz to reply :P[/s]
  • Maybe more stuff
« Last Edit: October 25, 2007, 12:50:14 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: CommandBox
« Reply #10 on: October 24, 2007, 08:35:56 pm »
sounds good for now :)

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: CommandBox
« Reply #11 on: October 25, 2007, 12:32:36 am »
/god: I will add this, but I will have a diff way then fistbox (OnPlayerDamage Result:=0) (hey toumaz, does result in onplayerdamage change damage done?)
First off, that's how it's done in Fistbox as well; seeing as there's no other way to properly do it.
And yes, it does. You need to use a rather high negative value in order to make the player completely invulnerable against explosions (-9999 should be well sufficient).

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: CommandBox
« Reply #12 on: October 25, 2007, 12:47:06 pm »
so you are letting me use /god mode? thanks! are you happy I'm changing the script name?

(I know why the health dissapears now, you use negative number :P)

how might I make my variables more efficiant? (and should I round /pos, I think I should)

(suggestion time :P)
for Fistbox, you should "install" a dummy bot! (copy an existing bot and set everything to 0 (except name, that should be "Dummy" and filename "Dummy")) and allow ppl to add maybe only 8 or so (2 on each team) (for testing weapon mod damage (for the people serious about it:P))
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Diss

  • Guest
Re: CommandBox
« Reply #13 on: October 25, 2007, 02:13:07 pm »
Soldat must hate me as it won't work :(
It says the script loaded but I tried them all and nothing happened :S
make sure ur admin ^^

I was admin, and to make sure I did a few commands that admins can do.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: CommandBox
« Reply #14 on: October 25, 2007, 03:02:20 pm »
did you use chat key to use commands? if so, don't, use / instead.

Date Posted: October 25, 2007, 03:59:40 pm
oh and did you include all of the parameters in your command? (/spawn 1 1 0 0 spawns deagles at player 1 (no offsets) and /create 1 0 0 0 0 100 4 1 makes m79 nade at player 1 (no velocity or offsets))
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline Quantifier

  • Major
  • *
  • Posts: 70
Re: CommandBox
« Reply #15 on: October 25, 2007, 03:41:21 pm »
Loops whose only intention is to handle players are better off with the iteration variable as a byte, seeing as it's a bit more memory efficient

I wouldn't be so sure about it. You _could_ gain 3 bytes, but they most probably end up unused anyway, to keep memory aligned to full words.

Diss

  • Guest
Re: CommandBox
« Reply #16 on: October 26, 2007, 02:16:06 pm »
If you reread what I posted, you will see that I said "I did a few commands that admins can do."
Which implies I used '/' and not the chat button.

Had no idea if that second part was too me, but yes I tried various combinations of the numbers and nothing work.
E.g- /spawn 1 1 0 0, /spawn1100, /spawn 1100
Nothing worked for me.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: CommandBox
« Reply #17 on: October 26, 2007, 03:34:55 pm »
hmmm... not sure wtf is wrong then...

I',m working on /help now, will do /pos later, and /tele tomorro maybe

Date Posted: October 26, 2007, 04:13:21 pm
Loops whose only intention is to handle players are better off with the iteration variable as a byte, seeing as it's a bit more memory efficient

I wouldn't be so sure about it. You _could_ gain 3 bytes, but they most probably end up unused anyway, to keep memory aligned to full words.
??? :/
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Diss

  • Guest
Re: CommandBox
« Reply #18 on: October 28, 2007, 10:33:49 am »
Ahhhh nvm, got it to work.
But I am having issues when you do /spawn and /create.
When I would put 1 for the player id, it will spawn where alot of medkits do, rather than their feet.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: CommandBox
« Reply #19 on: October 29, 2007, 12:35:55 pm »
I fixed that, will release next version soon. not fin'd yet because of fistbox Source code being released :):):) I ♥ (<3) fistbox

Date Posted: October 29, 2007, 01:30:43 pm
(right now it spawns at the coords you give :P)
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."