Official Soldat Forums
Server Talk => Scripting Releases => Topic started by: Kavukamari 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:
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...
-
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
-
(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
-
Suggestions:
you could make every player be able to do, like i mentioned, ;)
if you must... (OnCommand changes to OnPlayerCommand)
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)
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
(sorry fistbox, mine is a "box" too)
Original name and concept, eh >:|
I'll change the name to CommandCrate, ok? better? (not much change)
Few thoughts:
Use proper and more efficient variable declarations instead of loads of global variants
suggestions? should I array my temps instead?
You'd preferably want exception handling to tell the player he's messing stuff up
I thought I covered everything :/
Read up on the case statement and use that instead of the myriads of if's
I'll search...
Your code indentation is fugly, to say the least
O.o what's wrong T_T I add more double spaces after new begins
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
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
-
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 ;)
-
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
-
ok. ill think up somemore soon ;)
-
Soldat must hate me as it won't work :(
It says the script loaded but I tried them all and nothing happened :S
-
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 ^^
-
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
-
sounds good for now :)
-
/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).
-
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))
-
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.
-
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))
-
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.
-
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.
-
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.
??? :/
-
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.
-
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)
-
Hurray :P
-
When i say /force 1 5 7 0 then server kick me BE ;/ and when i say /active 1 5 true nothing is Power i must On All Gun for Active and unactive ? How i can use this 2 commands ?
-
When i say /force 1 5 7 0 then server kick me BE ;/ and when i say /active 1 5 true nothing is Power i must On All Gun for Active and unactive ? How i can use this 2 commands ?
It's not a BE kick, it's the built in anti-cheat system in the server. If you want to use certain weapons you need to disable it in soldat.ini.
-
Say me where is this on the Soldat.ini files and this /active (num) , (gun) true i say and this is not work why ?? And Kills too. I must power Gun in Soldat.ini or something ? :(
-
/active num num true/false (second num is gun number, 0=socom 1=deagles 2=hk 3=ak 4=steyr 5=spas 6=ruger 7=m79 8=barret 9=minimi 10=minigun 11=knife 12=saw 13=law I think)
/active 2 1 false would disable Deagles for player 2
for force, you could make sure you is admin (not just joining 172.0.0.1 and trying commands) /adminlog *password*
then you cant be kicked >:)
Date Posted: October 31, 2007, 01:43:15 pm
oh and every parameter in each command is seperated by only one space (nothing confusing just "/command blah meep wutever")
-
Hm.. but in Soldat.ini change something ? Then : /active (1 - player num) ? (3 - gun ak) true or false ok , /force num gun gun ammo ok i later check this thx :D
-
Only thing you would need to change to make weapons active/disabled in soldat.ini is this:
Weapon_1=1
Weapon_2=1
Weapon_3=1
Weapon_4=1
Weapon_5=1
Weapon_6=1
Weapon_7=1
Weapon_8=1
Weapon_9=1
Weapon_10=1
Weapon_11=1
Weapon_12=1
Weapon_13=1
Weapon_14=1
*Set for 1 active, and 0 for disable.*
Kav posted the numbers of the weapons for these.
@Kav
If you join your server as 127.0.0.1, then you are already an admin that is logged in. There i no need for the /adminlog [password]
Also, rofl at "/command blah meep wutever
-
But i have Climb Server i am admin and i want when enter on server can be use this commands /force and /active for my only. When enter player he don't see toggle of weapon and don't can take weapon. Only i hm.. but i don't now how make this. Sorry for my Englisch i learn it , im Polisch ;P
-
if it is climb server then you have to enable the weapon (/active # # true)
if you want to give weapon temporarily, do /force, then when person dies, they will lose weapon
(/force [primary] [secondary] [ammo])
but don't say you gave them weapon :P they will get annoying: "Give me weapon", "weapon please", "weapon gimme!!", "I wanna be admin", "give me weapon now" all from same person D:
then if you don't give them stuff or let them be admin, they'll try to use your name to use admin powers :(
then they'll give up (hopefully)
But they might not :(
-
I have two questions else :P. First if i want give somebody gun then obtain this but if i want give Flamer or Bow or Mode Flam guys get Ban. Next when i say command /spawn 3 - ak 1 - my num 0 and 0 then weapon appears on center of map but if i say /mega spawn 3 - ak 0 and 0 then all get weapon. Weapon is not on the middle only when i say /spawn for me :( Sorry for Englisch ;P
-
I have two questions else :P. First if i want give somebody gun then obtain this but if i want give Flamer or Bow or Mode Flam guys get Ban. Next when i say command /spawn 3 - ak 1 - my num 0 and 0 then weapon appears on center of map but if i say /mega spawn 3 - ak 0 and 0 then all get weapon. Weapon is not on the middle only when i say /spawn for me :( Sorry for Englisch ;P
On your 1st question...I had no idea what you said there.
On your 2nd question, Kav said it is fixed if I read correctly.
-
Hunter91: Englisch -> English*
-
I have two questions else :P. First if i want give somebody gun then obtain this but if i want give Flamer or Bow or Mode Flam guys get Ban. Next when i say command /spawn 3 - ak 1 - my num 0 and 0 then weapon appears on center of map but if i say /mega spawn 3 - ak 0 and 0 then all get weapon. Weapon is not on the middle only when i say /spawn for me :( Sorry for Englisch ;P
ak would be /spawn *player* 3 0 0 not /spawn *player* ak 0 0 (you play too much fistbox :P )
that's why I posted the weapon numbers (and you can't spawn more than one weap for one person with one command, just repeat command for multiples)
-
when i run this script on my server i get an error in the console:
invalid float
-
please post the full error
-
that was full error, it says "Command box -> invalid float"
i fixed it, just took a little bit of editing (im not a noob, just havent been with soldat forums for very long)
-
what did you have to change? maybe I have already fixed it in the version on my comp (I'm not sure if it is a diff. ver, but it works on my comp)
-
well, i think it is just somthing I did, i was editing it before to see some functions and commands (im in the process of making a spawn script) and i think i added a variable to a function when i was editing it(just to mess around with functions and see what each part dose) cuz i had the zip file, and i un-ziped it again, and it work just fine.
-
do you think I should rewrite the script using the Case statement?
-
do you think I should rewrite the script using the Case statement?
for conventions sake, yes, it looks better and its easier to fix.
-
do you think I should rewrite the script using the Case statement?
yes, that would probably help, looking at your script.. it will help alot with cleaning up