Author Topic: VRockers Base Scripts  (Read 7058 times)

VRocker

  • Liberty Unleashed Developer
  • Administrator
  • Full Member
  • ******
  • Posts: 342
  • Karma: +43/-15
    • View Profile
    • Madnight Software
VRockers Base Scripts
« on: June 28, 2011, 11:40:10 pm »
The last 2 days i have been working on a set of scripts for an idea i had, and thought i would share the base stuff with the community.

Note: These are not finished scripts and are intended as a base or as learning material. You should add your own commands for your own functionality

The scripts include the following:

  • A basic accounts system
  • An admin system with differant admin levels
  • An area system similar to Aerons MTA0.5 area system
  • A cash and bank system

The commands that are currently implemented are:
  • register
  • login
  • logout
  • autologin
  • admins
  • sun
  • cloud
  • rain
  • fog
  • kick
  • ban
  • setlevel
  • setcmdlevel
  • cash
  • bank
  • deposit
  • withdraw
  • send
  • wire
  • loc
  • p
  • del
  • savearea

It can be downloaded Here

Hopefully these can help some people with their scripts :)


bl0x0ld

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: VRockers Base Scripts
« Reply #1 on: June 29, 2011, 01:26:04 am »
Awesome!, now all you need to do is make a small tut for nubs like me so we can do this too =D

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: VRockers Base Scripts
« Reply #2 on: June 29, 2011, 11:40:31 am »
You can't really make a tutorial about scripting. You need to learn it by watching scripts like these and try to understand the syntax and maybe even make your own commands (or at least try to, we can always help you if you're stuck). Just don't start with too difficult commands and you'll learn fast.

(That's what I do at least...)

EDIT: Forgot to say, Nice work VRocker!

Windlord

  • Guest
Re: VRockers Base Scripts
« Reply #3 on: June 29, 2011, 07:33:41 pm »
Nice :)

I like how there's plenty of spaces between bits of the code as well :D

Knucis

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +2/-2
    • View Profile
Re: VRockers Base Scripts
« Reply #4 on: June 30, 2011, 01:37:53 pm »
Nice! Looks awesome!

matheo

  • Jr. Member
  • **
  • Posts: 87
  • Karma: +2/-20
  • Virtual owners - Clan Leader
    • View Profile
Re: VRockers Base Scripts
« Reply #5 on: July 07, 2011, 02:43:11 pm »
Lol very nice script vrocker !
We recrutiment to clan !!! ;-)

Laura

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: VRockers Base Scripts
« Reply #6 on: July 30, 2011, 05:14:34 am »
Recently downloaded this, added to my server, and made my own commands in a separate .nut, made sure it would load, and it didn't work. It conflicted with the registration/login system. Any idea what I'm doing wrong?

VRocker

  • Liberty Unleashed Developer
  • Administrator
  • Full Member
  • ******
  • Posts: 342
  • Karma: +43/-15
    • View Profile
    • Madnight Software
Re: VRockers Base Scripts
« Reply #7 on: July 30, 2011, 01:38:31 pm »
If you are using onPlayerCommand in your new script then using dofile in another script to include it, the onPlayerCommand will override the one in these scripts.

If you look in Commands.nut you will see i forward the command to other scripts with calls such as ProcessAdminCommands.
If you change the onPlayerCommand in your script to something like ProcessMyCommands then call them in Commands.nut, you should have no problems :)


Jan

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: VRockers Base Scripts
« Reply #8 on: July 30, 2011, 02:30:27 pm »
I cant add myself as lvl 6, it gets reset back to lvl 0

VRocker

  • Liberty Unleashed Developer
  • Administrator
  • Full Member
  • ******
  • Posts: 342
  • Karma: +43/-15
    • View Profile
    • Madnight Software
Re: VRockers Base Scripts
« Reply #9 on: July 30, 2011, 02:33:08 pm »
You need to modify the hsh file when the server isn't running or the script isnt loaded, otherwise the server will overwrite it when you close it or when a player joins.


Jan

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: VRockers Base Scripts
« Reply #10 on: July 30, 2011, 02:38:34 pm »
When i try to spawn a car it only asks for ID not as normal Name (only ID) anyway how to fix it and the 2nd thing is it spams Invalid Command when i spam /wep (id) How to fix both of em?

VRocker

  • Liberty Unleashed Developer
  • Administrator
  • Full Member
  • ******
  • Posts: 342
  • Karma: +43/-15
    • View Profile
    • Madnight Software
Re: VRockers Base Scripts
« Reply #11 on: July 30, 2011, 02:50:04 pm »
When i try to spawn a car it only asks for ID not as normal Name (only ID) anyway how to fix it and the 2nd thing is it spams Invalid Command when i spam /wep (id) How to fix both of em?

To spawn a car based on the name, you can use the function GetVehicleIDFromName. Heres an example:

Code: (squirrel) [Select]
if ( cmd == "spawncar" )
{
if ( IsNum( args ) )
{
// an ID was entered
CreateVehicle( args.tointeger(), plr.Pos, plr.Angle );
MessagePlayer( "Created vehicle with model " + args, plr );
}
else
{
local vehid = GetVehicleIDFromName( args );
CreateVehicle( vehid, plr.Pos, plr.Angle );
MessagePlayer( "Created vehicle with model " + vehid, plr );
}
}

To stop it saying Invalid command, make the function you called return 1; like i have done in my commands.


Bob

  • Jr. Member
  • **
  • Posts: 69
  • Karma: +4/-0
    • View Profile
Re: VRockers Base Scripts
« Reply #12 on: November 24, 2011, 02:18:57 am »
Very good, I've been interested in looking into scripting for LU servers more recently so its great to have some material to start with and learn from.

EDIT:  I'm getting LoadScripts() and onScriptLoad() error on Functions.nut at line 14 and Main.nut at line 23. I don't understand programming right now so I'm not sure why. I haven't edited the files.

Fixed it lol.
« Last Edit: November 24, 2011, 05:42:34 am by Ammonite »

Thomas1907

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: VRockers Base Scripts
« Reply #13 on: April 28, 2012, 04:23:22 pm »
Hey , if i set my level to level 6 in the levels.hsh
It says im level -1 ? How to fix this?
Also, i havent set autologin or anything, i think that happens with ip ?

Thomas1907

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: VRockers Base Scripts
« Reply #14 on: April 29, 2012, 03:25:44 pm »
Level -1 means unregistered player, level 0 is registered player.
When you are changing your level the server must be closed but make sure that you registered previously.
I registered yes, (/register password) and then go outgame, and stop the server, i go in the levels file, and then change 0 to 6 at my name, whats the problem there?

 

© Liberty Unleashed Team.