Liberty Unleashed

Off Topic => General Chat => Topic started by: VRocker on April 23, 2009, 09:55:08 pm

Title: New VC:MP Server (With Squirrel!)
Post by: VRocker on April 23, 2009, 09:55:08 pm
Heres something me, Juppi (http://forum.liberty-unleashed.co.uk/index.php?action=profile;u=185) and Knight2k9 have been working on for a while. Its a remake of the VCMP 0.3z server which has new features, better stability and inbuilt scripting!
This server can be used to learn Squirrel in preperation for Liberty Unleashed. The naming and usage of the functions etc are similar to LU to make it easier to learn.

The server has been thoroughly tested and doesn't have the exploits the original server has. This includes crashes (so conventional server crashers cant kill the server).
It also has inbuilt server-side scripting support via Squirrel (http://squirrel-lang.org). This allows you to make scripts and not have to run mIRC 24/7 for them to work.
A list of script functions/callbacks can be found at http://liberty-unleashed.co.uk/VCWiki/Scripting/squirrel (http://liberty-unleashed.co.uk/VCWiki/Scripting/squirrel)

As you can see from the script functions, you can now Mute players, make an ignore list and disable drivebys.

To use this server, modify the server.conf file with your details. This is basically a normal config file but in XML.
Then borrow the Announce.exe from the original VCMP server and plae it in the same directory as the new server.
Run the server and hey presto, a newer, crashproof server :)

You can download the server Here (http://liberty-unleashed.co.uk/vcmp/VCMPServer.zip) (Or linux server Here (http://liberty-unleashed.co.uk/vcmp/VCMPServer-linux.zip))
If you wish to script with mirc still, a single connection DLL is available Here (http://liberty-unleashed.co.uk/vcmp/VCMP-mIRC2.zip)

Any bugs or help with scripting, post here and someone will help out :)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: StriKe on April 24, 2009, 09:12:40 am
Gr8 Work Vr  :o  :o
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on April 24, 2009, 05:03:02 pm
Hi :)
Quote
Any bugs or help with scripting, post here and someone will help out Smiley
Heh, I'm first :D

This idea to make a better version of VCMP 0.3z server was great :D. But... I've tried to run a server, using hamachi. Hmm server ping 9999 but I can connect :P.

And I have a question: how to run the mIRC scripts on this server? I've tried the Win Server, converted an INI map to XML using this mirc tool, that u gave me yesterday, then copied the announce file. Server works. RCON pass and port are the same like this from the VCMP ini map. Downloaded the mIRC DLL, replaced the old VCMP dll, made also be u, and then I connect... But the script can't connect D: . I've tried changing the Pass [XML and in mIRC vars] and many other things, but every time it don't connect to the server. But what is funny: when I use the dll for normal VCMP... It connect! In the console I see, that I connected to RCON, but I can't still use the scripts on server [on mIRC no msg, thet connected].

Any ideas for this?
Thxx :P.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Dobi on April 24, 2009, 06:40:16 pm
Not bad, not bad. I'd even say really good. But I'm no more playing VCMP....
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on April 24, 2009, 07:10:59 pm
Well NC, the mirc dll is differant from the other dll that people use. The one for this server is currently only a single c onnection one, the other one is multi. So some parameters are differant (No server id etc)

If you look at the included script with the new dll, you will see it also send a nickname parameter, without this it wont connect.

You'll have to modify your script to work with the dll until somebody writes a new one based on the old params
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on April 24, 2009, 08:40:38 pm
If you look at the included script with the new dll, you will see it also send a nickname parameter, without this it wont connect.

Hmm or I'm dumb or what, cause in this VCMP-mIRC2.zip is only the DLL, without any scripts ;p.

Well are there many changes between this two DLLs? Or only a few? I spend much time editing a script that uses the Multi connection DLL, but ur Server Tool is rly good. So I dunno what to do now :P.

Well and Squirel is a bit difficult for me, more of things that I created in Squirel gaves an error ;(. But I'm still reading the wiki ;).
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on April 27, 2009, 06:06:50 pm
Ah sorry, forgot to include the script and cant seem to find it. When i find it i'll let you know.

The main changes between the DLLs is that there is no server ID parameter in this dll and vcmp.connect also takes a nickname param.

If you need help with squirrel you can pastebin the script, tell us the error and we will try to help :)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on April 29, 2009, 02:37:40 pm
Still not found the script :( sorry.

I have however uploaded new versions of both the windows and linux servers. This includes fixes for timers, kick/bans etc.

They also come with a newer default squirrel script which i wrote. Its only basic but shows how to do some things.

I have also put together a 64bit version of the server for people with 64bit servers. It can be found Here (http://liberty-unleashed.co.uk/vcmp/VCMPServer64.zip) (Windows only at the moment)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on April 29, 2009, 04:21:16 pm
Ok no problem, if u dont find it, nothing would happen  :)

For me squirrel isn't easy, so for now i will use the old VCMP server. Maybe one day, i would have much time and the wiki would be complete, maybe then i will learn this programming language :).

I looked at the wiki now... There is a function IsAdmin. So using this function, am i able to create commands only for admin, right? And admin in vcmp is this person who logged in using /admin RCONpass. And here is i think a big minus for this. Cause some players, that aren't admins, knows the pass [like other admins tell it them]. So they have to log in using this pass and they can get control over the all server  :-\ ?

Btw. vcmp... After the official VCMP forum is broken, will u still update ur VCMP dll?
Ach and i'm waiting for a next public release od LU or VU ;p.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on April 30, 2009, 12:05:31 am
Well the multi server dll is still in production and should be done soon so you can still use mirc when thats done.
I agree the wiki should be completed but its tedius work that requires time, which some of us dont have being involved in many differant projects.

The IsAdmin func is for use with the /admin thing built into vcmp but its rare that anybody will ever use it. Its just there incase people need it, better to have it and not need it than not have it and need it :P
Obviously you can still write your own admin system and make your own IsAdmin function, so its not really a bad thing.

And yes, i will still update the old dll if it needs updating :)

LU/VU is sstill very much in active development too :) may have something to put on the dev blog soon :)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on April 30, 2009, 05:06:10 pm
Heh, VRocker only great news today  ;D

Oh yes, we are only humans [or, arent we :> ?] so we work only so much as we can :P.

Good luck :)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on May 28, 2009, 02:37:19 pm
Updated the server today, fixed a lot of bugs.

The vector bug is fixed, now returns the x y z instead of x x x.
Fixed a bug in Sqlite where some things were failing.
Added CallFunc to the function list. This allows you to execute functions from other scripts without having to do dofile() (syntax: CallFunc( "script.nut", "MyFunction", param1, param2 etc ))
Optimised the code a little for faster execution
Fixed the scoreboard in the server browser displaying values only up to 255
Other various fixes around the code.

Juppi is still working on the multi-server mirc dll so we still dont have a release for that. It should be soon though.

The 32bit windows and linux servers are uploaded at the normal place, aswell as the 64bit window server :)

Any problems, please let me or Juppi know.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on May 28, 2009, 06:56:40 pm
Great great great :D

Maybe u r able to do this stuff from VCMP 0.3z r2 also :) ? Cause this project is every day better, probably no one thought that one day VCMP will have a built in script lang ;).

Quote
Juppi is still working on the multi-server mirc dll so we still dont have a release for that. It should be soon though.
I'm crossing my fingers  ;D
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on June 16, 2009, 12:19:10 pm
For anyone whos using this, theres another new version out. It has a lot of differant bug fixes which is too much to list. Main fixes are a memory leak fix and fixes to the rcon stuff. The updated servers are in the same place as always.

Also for anybody that still wants to use mirc but doesn't want to convert their scripts to a single DLL, heres that multi dll i promised :) http://liberty-unleashed.co.uk/vcmp/VCMP-mIRC-new.zip (http://liberty-unleashed.co.uk/vcmp/VCMP-mIRC-new.zip)
Theres a few small changes to this dll, The biggest thing being the connection stuff. If you check the included script you will see its slightly differant from the original DLL as it has a parameter on Connect for a name (used to distinguise admins in the server) and also a $dllcall line. These are required! The dllcall makes the dll listen for any incoming data so without this it will not work.

The aliases have also changed slightly, so might be best to just copy and paste from the included script into your own. I will be prodding Force to update FBS for this new dll.

Thanks to all the people that reported bugs :)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on June 17, 2009, 10:41:08 pm
:) the dll is working good, but some aliases are wrong [like this that i gave yesterday on irc]. And the vcmp.setweapon now works good, setting ammo dont fails :P.

Im using FBS, and i had to copy all the aliases [and patch some of them]. E.g. the Car database hash doesnt work, but im not worry, cause there are very similar $vcmp aliases.

Here the connect code for FBS, made by u VR :P
Code: [Select]
alias vcmp.listen {}

alias FBS.Connect {
  if ( $dll(" $+ $scriptdir $+ vcmp.dll $+ ", Connect, 1 %serverip %rconport %pass NICK) ) {
    FBS.echo 4** 2FBS $FBS.Version connecting to %servername $+ .
    $dllcall( $qt( $scriptdir $+ vcmp.dll ), vcmp.listen, Listen, 1 )
    if ($nick != %botname) /nick %botname
  }
}

In ur code, there was my nick instead NICK here ;p but when i use a vcmp.say, every text looks like NICK <text>. Is it possible to have only the text, without the nick?
Solved! The admin chat signal was different from the old DLL for bakas server. In the old, $2 was for MSG, and here $3 is for it...

And i think the disconnect signal needs also to be modifed. Cause when im shutting down the server, the IRC script still thinks that script connected to a online server :/. On the old servers dll, after shutting down the server, there was after some secs the info, but here not :(.

Could it be possible to add some new part reasons to vcmp.partreason? Cause when i crash in game, it displays "Quit", but i have a crashed, would be better "Crash" or smthing else as part reason.

Ive got today an idea ;). Could it be haxable?
(http://img15.imageshack.us/img15/7672/gtavc2009061721243163.jpg)
The client support this form of text [Ammunation]. But it would be reaaaaaly cool, if i could enter my own text in this light black box :P.

For now thats all, i'm everyday reading the changelong on code.google.com :D.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Stoku on June 18, 2009, 08:23:58 pm
Quote
Could it be possible to add some new part reasons to vcmp.partreason? Cause when i crash in game, it displays "Quit", but i have a crashed, would be better "Crash" or smthing else as part reason.
I think it's impossible, because client is disconected on crash and it will be impossible to send a part info packet after that.

Quote
Ive got today an idea  ;). Could it be haxable?
Yes it can, but you have to have a hack what will change that text and send it to other players on your server :P. The other way is slapping VC-MP team to add it to the next version of VC-MP ;).
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on June 18, 2009, 10:08:36 pm
Buuu, and i think adding "Crash" its possible. Worked on the mIRC script, alias code:
Code: [Select]
alias qreason {
  if ($1 == 0) return (Crash/Lost)
  elseif ($1 == 1) return (Quit)
  elseif ($1 == 2) return (Kick)
}

Quote
The other way is slapping VC-MP team to add it to the next version of VC-MP
Good joke, VCMP team is laaaazy....

I think VRocker, Juppi and Knight2k9 can hax this :).
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on June 19, 2009, 12:58:17 am
umm that original idea is very possible in squirrel... since onPlayerPart sends a reason ID just as mirc does. Although its a bad way of detecting crashes, since some time people really do just time out.

Its not possible to change the ammunation text without modifying the client, which would involve a big rewrite and ould then turn it into something thats not vcmp anymore. It cannot be done via the server anyway.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on June 19, 2009, 09:39:06 pm
some time people really do just time out.

For me timeout means Crash or Lost connection. I dont see any other reasons, why a player should time out and quit the server.

I think i found a bug in the vcmp.settime $1 <HOUR> <MINUTE>. If i set e.g. 20 06, the hour changes only to 20, but minutes are still the same...
Code: [Select]
vcmp.settime $1 $4 $5
Ym, what a pity with this Ammu text ;(.

Ok, now only i need to have the 2 answers to my post from the 1st page :).

Or... The respawn pickup in squirrel still doesnt work for me. Adtec and Force tried to help me, but it doesnt respawn :/.

I made this code for test:
Code: [Select]
function onPickupPickedUp( player, pickup ) {
if( pickup.Model == 366 ) {
Message( "omg its a " + pickup.Model );
}
}
And this works, but where i have to put now the respawn stuff? After a time delay ofc :).

Solved after few hmm hours :P... Here the code for some other nubs :D
Code: [Select]
  if ( pickup.Model == ID ) {
    MessagePlayer( "bla bla", player );
    pickup.RespawnTime = 3;
  }
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on June 29, 2009, 10:59:39 am
Just a quick update. Me and Juppi have fixed a couple of things in the server since the last post.


Remember if you find any bugs, please let us know and we will fix them as soon as we can :)

Edit: Fixed the SetTime bug in the rcon in the windows server. Found it just after i closed the linux server so it will be compiled at another time.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on June 29, 2009, 01:20:22 pm
Bugs:
1. Split returns an array error :@
(http://img223.imageshack.us/img223/5580/split.jpg)
This was an example from Squirrel's web page
Code: [Select]
eg.
local a = split("1.2-3;4/5",".-/;");
// the result will be  [1,2,3,4,5]

2. Kick on Join or on Spawn = auto closing the Server :(
(http://img197.imageshack.us/img197/4584/kicka.jpg)
In this example, it was a kick when the Nickname is a number. My code:
Code: [Select]
if ( IsNum( player.Name ) ) {
 Message( "** Auto-kick " + player.Name + ", bla bla." );
    Announce( "Kick: nick", player );
 KickPlayer( player );
 }
But what funny, if I use a timer e.g.
Code: [Select]
NewTimer( "KickPlayer", 600, 1, player );The server is not auto closing.

3. HP decreasing bug  ???
I made a goto cmd, but if someone use it, immediately HP is decreasing by 20%, e.g. from 100% hp -> 80% hp, from 77% hp -> 57% hp, but if a player has less then 20% hp...
(http://img25.imageshack.us/img25/4700/hp1c.jpg)
(http://img33.imageshack.us/img33/6199/hp2l.jpg)
And sometimes, the player is flying in the air (classic vcmp bug).
Code: [Select]
player.Health = ( player.Health - 20 );
4. Small spelling bugs:
From the get weapon name from id:
id 32 returns m60, should be M60 :D
id 30 was probably Rocketlauncer, should be Rocket Launcher

5. Counting players on player part
If im leaving the server, then it's empty :P. But i used the GetPlayers() in the Part function, and this returns 1 player :(. I know, a small bug but maybe its worth to report :).

Help :) :
1. From Squirrels web page:
Code: [Select]
RAND_MAX

the maximum value that can be returned by the rand() function
But how to set the RAND_MAX to e.g. 10? I found something about RAND_MAX on a C forum :) but the 1st random number is always the same :/.
Code: [Select]
local max = 10;
    local asd = (rand() % max) + NUMBER;

2. Again Squirrels web page:
Code: [Select]
date([time], [format]);

returns a table containing a date/time splitted in the slots:

sec Seconds after minute (0 - 59).
min Minutes after hour (0 - 59).
hour Hours since midnight (0 - 23).
day Day of month (1 - 31).
month Month (0 - 11; January = 0).
year Year (current year).
wday Day of week (0 - 6; Sunday = 0).
yday Day of year (0 - 365; January 1 = 0).

if time is omitted the current time is used.
if format can be 'l' local time or 'u' UTC time, if omitted is defaulted as 'l'(local time).
But every time i tried smthing, nothing happend  :-[ . Maybe someone could say how does the code look like, to return HOUR:MINUTE ?

Suggestions:
1. I made now 500 squirrel code lines ^^ but i would like to echo irc some actions like: after setting weather with a "squirreled" cmd, the Message [e.g. Admin player.Name has changed weather ID to...] could be echoed. Maybe a print2 or smthing :) ?

2. I'm trying to do the register and login stuff. I dont think about INI, cause for many players, could work slowly, SQL in some way dont worked for my (the sample code, if i typed /c stats only was: Stats for player, but nothing else, and if i pasted the sample cmd into a new main.nut, worked  :-\ ), so i was thinking about the XML stuff. Is this a good choice :P ? And if yes, i would be happy if someone could in the next days or weeks describe it in the wiki.

3. After all i like the WeatherRate :) . But it would be cool, if i could set, what weather IDs can be included in this WeatherRate. Here an example [server.conf]:
Quote
<WeatherRate>NUMBER</WeatherRate> // if not set use default
<WeatherRateNextChoose>FROM FIRST TO LAST/RANDOM </WeatherRateNextChoose>// if not set = default, if random, the next weather ID will be one of this bellow
---skins, pickups stuff---
<Weather ID="ID" TimeRateToChangeThisWeather="AFTER HOW MANY SECS THE WEATHER WILL BE CHANGED, IF DEFAULT=USE NUMBER FROM WEATHER RATE"/> // if the function [?] <WeatherID> not found, use default weather IDs from server, but if this set, the WeatherRate will choose the IDs from <WeatherID>
<Weather.... />
<Weather.... />
 

Cause i would like that WeatherRate changes the weather also to some experimental IDs like "5426", which worked pretty good, not like on baka's server ><.

4. To squirrels function:
GetSpeed( player );
Getting the speed in mph that everyone can easy convert to kmh or something else.
GetDistance( player, plr ); or ( player, Vector( XYZ ) ); to say e.g. how far is the player from Respawn point
In meters ofc :)
GetIdleTime( player );
In secs.

5. To the KeyBind:
OnFootActionKey <TAB>
And maybe a useless vehicle key, cause i have a great idea for a key bind in vehicle, but the key should be useless and working both for driver and passenger. Is there someone :P ? Maybe also action key?

Thx for reading :D

Edited this post 20 times or more :D
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Juppi on June 29, 2009, 11:45:33 pm
1. is not a bug; a will be the pointer to the created array so you cant print the contents of the array just like that. Instead, you can print whats in the array slots, for example print( a[0] );

2. didnt manage to re-create this, tried your script but the server was still online; someone might look into it later. Using a timer might be a good idea if this keeps happening

3. is not really a bug either, if you do health - 20 when health is <20 then the result will be negative, and since the health is an unsigned char it will go to 200 something which VC:MP will round to 100. You could fix this in your script by doing something like
Code: (squirrel) [Select]
local hp = player.Health - 20;
player.Health = hp<0 ? 0 : hp;

4. Those were copied from the old multi-dll, might be fixed in the next server update if anyone bothers to fix them *hides*

5. GetPlayers() returns the current count in player pool, and since the leaving player has not been removed yet (cant remove or the script couldnt get his info!) the function returns the player count just BEFORE the player leaves. Easily compensated by doing GetPlayers() - 1 :P



1. You cant change the RAND_MAX value afaik, however you can manipulate the values like you show in the code, by taking modulo ( rand() % max ). That shouldnt return same values.

2. date() is part of the system library which hasnt been implemented into the server. However there is GetFullTime() (http://liberty-unleashed.co.uk/VCWiki/Scripting/Squirrel/Functions/Misc/GetFullTime), which returns both date and time in the same form than mIRC $fulldate does. You can grab the time token from it



1. If you have an irc echo script, why not just echo the message when using the command..? That way you could also customise the colours etc for each command :P

2. Depends how big your server is, SQLite is the best choise especially if your server and the account number is big, however you can also use SQLite improperly. XML is better than ini because the functions implemented into the server load the file into memory and edit it there till you save it, unlike the ini funcs which keep reading and writing the file over and over again.

3. Well you could script your own weather change system, for example use a timer which continuously changes the weather and reads the pre-defined weather id's from an array or something like that.

4. A distance function is relatively easy to script:

Code: (squirrel) [Select]
function GetDistance( v1, v2 )
{
return sqrt( (v2.x-v1.x)*(v2.x-v1.x) + (v2.y-v1.y)*(v2.y-v1.y) + (v2.z-v1.z)*(v2.z-v1.z) );
}

// Example: prints player distance to (0,0,0)
print( GetDistance( player.Pos, Vector( 0, 0, 0 ) ) );

Speed could also be scripted, check how far player has moved on a certain time, divide that by the time (could use a constant timer for that). We had a similar speedo on MDR at some point, however a serverside speedo can never be as accurate as a clientside one would be.

5. All the possible keys are already listed on the wiki, those are all the keys that can be retrieved from the sync data. You'll have to use them. Adding more keys would include editing the client (and would be pointless for syncing the movements anyways)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on June 30, 2009, 01:54:41 pm
Well thx for the answers :D.

I have tried to do a very stupid script: on player join auto kick. And the server wasnt shutting down  :o . Hmm so i guess i have smthing broken in my script [but reload_scripts works  ;) ]. Anyway the timer solve it. From beginning i have tried to kick the player after 20 ms, so the player only saw the Kaufman Cabs interior and auto quitted without any msg :D.

Quote
when health is <20 then the result will be negative, and since the health is an unsigned char it will go to 200 something which VC:MP will round to 100.

Hmm i dont remember now, but i have a similar one command in the mirc script with old dll and havent got this problem. Anyway ur code works :).

Quote
You cant change the RAND_MAX value afaik

Pff so who needs this RAND_MAX if its useless  ::) ?

If i use the code for RAND e.g. on scripts load, then ok, every time is another number. But im making a Weapon Crates. It will give the player a weap ID X-Y. And everytime i pick the pickup, restart server and again pick it, they r still the same weap ids.
Example:
Server start.
Crate 1 -> ID 20
Crate 2 -> ID 30
Restart server
Crate 1 -> ID 20
Crate 2 -> ID 30
So not very randomly, but the same code used on scripts load gives always a new number....

Btw. Grenades and remote grenades are also crashy like on baka's server?

I have tried GetFullTime, yeah works good, but it returns too many informations like day of week or year :P. One time ago i wanted to do in mIRC a time synchronizer [ local host time -> game time ]. So i done vcmp.settime $1 $asctime(ymm hours?) and $asctime(for minutes). So if the library wasnt implented, im not able to do this in squirrel :( ?

Quote
If you have an irc echo script, why not just echo the message when using the command..? That way you could also customise the colours etc for each command

Ym... /me blames my english teacher :P
Cause if i made in mIRC a vcmp.say thing, it was echoed on the chan. If i do Message (); in squirrel, its not echoed [but visible in game] and i would like to echo it :P. Ofc i could do a cmd in squirrel e.g. /c test and do the same in mIRC but only visible in chan [ msg $chan bla bla ], but i think it would be more complicated then useful.

Quote
if your server and the account number is big

Hmm im not trying to do a second LW or XE :D.

Quote
Well you could script your own weather change system,

Too lazy for difficult scripts :P. Im now playing with squirrels "while" to teleport all players to me etc. Btw. the weather rate uses all weather IDs from 0 to 9?

Quote
A distance function is relatively easy to script:

Ymm yeah REALLY EASY after i saw the code :D. But anyway it should be as a Squirrel functions, because other nubs would like to use it too i guess ;).

Ah and final question  8) . On another topic VRocker said, how squirrel is good, briliant, easy and good for game scripts or smthing like that. But why when i type "squirrel lang" in google i dont get much results? And if i type "squirrel" i see more informations about this animal from the forest :P. I already saw forums for help with PAWN, LUA, C, C++, C-- :P scripting, but nothing about Squirrel [ok, one forum this at the official web page ^^].

HOLY! After few hours server on, played on LW... I think, before i shuted down and started again the server, so...
(http://img43.imageshack.us/img43/5876/wtffht.jpg)
[CTRL+ALT+DEL]

Ym and yeah, i ve got this "Unknown player" bug. After this, i couldnt join the server no more :(.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: MexikanoS on August 11, 2009, 09:17:15 pm
Hello! I want ask you about .ini files. I want make the command !savepos and !loadpos (i have maked for load with car etc.) But im making command like this: When i will bail from another vehicle but i've saved position in this vehicle i will back to my vehicle, but I don't know what .ini file i should use to save my own car ID :-\ Thanks for help guys! :)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on August 27, 2009, 10:10:18 am
Just got around to updating the server. Fixed quite a few bugs that were brought to my attention.

This includes:

I have also added PrivMessageAll, and fixed script stuff happening before remote clients receive any data.
For example:
Quote
<script> Your health: 100%
VRocker: !health


On another note, the project has been updated to use Visual Studio 2008 SP1, so you'd need these runtimes if you dont have them already. They can be found Here (http://www.microsoft.com/downloads/details.aspx?FamilyID=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&displaylang=en)

Thanks to everyone for finding these bugs and letting us know :)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on September 13, 2009, 08:13:50 pm
New suggestions * snap *

I think this is possible to do :P:

* GetHowManyPlayersAreInTheVehicle( vehicle's id)
Returns the number of players in a vehicle. I think its quite simple to script it [using while and checking how many times the player.Vehicle.ID will be the same as the number in ( ) ]. But i think if this will be a default Squirrel function, it could by used by many scripters [like for a check before using vehicle.Respawn, that is crashy ^ ]

* GetServerBuildDate
Returns the date when the server was compiled like 13/09/09. Can be useful for checking if our server hoster has updated teh server :P.

And this isnt probably possible ;)

* MovePlayerToSeat( player, seat number )
Moves the player to a seat. It was possible in VC single player [in the rob bank mission, botz in car have changed they seats].

* ChangePlayerName( player, newname )
In MTA SA is a command /nick newnick that changes our nick, and after this is a message Name is now know as NewName [similar to irc]. I think the server is holding all players nicknames, then why dont enable to change it :)?

* ChangePlayerTeam( player, Teamid )
Changing players team.
And questions:

Juppi said
Quote
Instead, you can print whats in the array slots, for example print( a[0] );
Ok and now i wanna make a /c kick command with NICK + REASON. Nick will be lets say in the array slot a[0]. But i cant specify how many words will be for the REASON. Then i would need something like "print everything from a[1] to end". Is this in some way possible?

From google code:
Quote
bool SetVehicleIndestructible( vehicle pVehicle )
I dont see this in the wiki. Is it possible to set some vehicles indestructible? And if yes: how?

From ini saving:
Quote
[bla bla]
AoDNC = 1234
Instead of [ and ], my nickname is saved as a - and a circle v_v. If i wanna print the content of the ini file with message, it returns AoD NC [without everything]. Is this a bug, that to ini arent saved [ and ]?
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Juppi on September 13, 2009, 09:48:10 pm
* GetHowManyPlayersAreInTheVehicle( vehicle's id)
Returns the number of players in a vehicle. I think its quite simple to script it [using while and checking how many times the player.Vehicle.ID will be the same as the number in ( ) ]. But i think if this will be a default Squirrel function, it could by used by many scripters [like for a check before using vehicle.Respawn, that is crashy ^ ]


Hmm that could be possible, i could take a look the next time i'm editing the code (no guarantees when that would be, LU still comes before this project D:)

* GetServerBuildDate
Returns the date when the server was compiled like 13/09/09. Can be useful for checking if our server hoster has updated teh server :P.


That could be useful if there was only one main build available. Now its possible that there are different builds from different people using random revisions of the code, so the server build date wouldnt tell much about the server.

* MovePlayerToSeat( player, seat number )
Moves the player to a seat. It was possible in VC single player [in the rob bank mission, botz in car have changed they seats].


That is not possible to do for the player that should be moved (no clientside code)

* ChangePlayerName( player, newname )
In MTA SA is a command /nick newnick that changes our nick, and after this is a message Name is now know as NewName [similar to irc]. I think the server is holding all players nicknames, then why dont enable to change it :)?


Same problem, no clientside code - it would work for players who join the server after the nick has been changed but not for the players who are currently online.

* ChangePlayerTeam( player, Teamid )
Changing players team.


Not possible since team data is only sent on player spawn.

Juppi said
Quote
Instead, you can print whats in the array slots, for example print( a[0] );

Ok and now i wanna make a /c kick command with NICK + REASON. Nick will be lets say in the array slot a[0]. But i cant specify how many words will be for the REASON. Then i would need something like "print everything from a[1] to end". Is this in some way possible?


You can get array length with a.len(). So you could make a gettok command which gets the tokens from 1 to a.len(), merges them and returns the result as a string.

From google code:
Quote
bool SetVehicleIndestructible( vehicle pVehicle )

I dont see this in the wiki. Is it possible to set some vehicles indestructible? And if yes: how?


That list is outdated, all the current functions are listed here: http://liberty-unleashed.co.uk/VCWiki/Scripting/squirrel
There was a command to set vehicles indestructible, but it was buggy (didnt work always due to VCMP's fail vehicle hp code) so i removed the command. You could try setting different values for vehicle health using vehicle.Health

From ini saving:
Quote
[bla bla]
AoDNC = 1234

Instead of [ and ], my nickname is saved as a - and a circle v_v. If i wanna print the content of the ini file with message, it returns AoD NC [without everything]. Is this a bug, that to ini arent saved [ and ]?


That seems to be a bug. There had to be some changes in the ini save code since [blah] means a new ini section and clan tags interfered with that, so [] was replaced with different characters. It should return [] though, someone will take a look at that later
Title: Re: New VC:MP Server (With Squirrel!)
Post by: VRocker on September 13, 2009, 10:19:39 pm
With regards to the ini thing, its not a bug. As juppi said, [ and ] in ini files will mean that it will get parsed as a new section, so [AoD]NC would mean it would need to read section AoD with the value NC, meaning the init file gets royally screwed. This happens in mirc too btw.

The solution was to replace any []'s with rarely used characters in the values stored. The server will re-parse these when reading so you can still ask it to read [AoD]NC and it will read the AoDNC part.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: NC on September 14, 2009, 10:30:47 pm
Quote
That could be useful if there was only one main build available.


Hmm...

Quote
Squirrel is a high level imperative/OO programming language, designed to be a powerful scripting tool that fits in the size, memory bandwidth, and real-time requirements of applications like games.

Then it must be a way to read this stuff! :P

(http://img10.imageshack.us/img10/2511/skli.jpg)

For example my IM [coded in... eek dunno :P ] is able to check what browser i have as default and whats the browser version.

Quote
That is not possible to do

;(. Hoping this will be possible to do in LU/VU :P.

Quote
This happens in mirc too btw.

But in mirc [ ] is replaced by ~ and ~. This looks better then a circle and - :).

Quote
The solution was to replace any []'s with rarely used characters in the values stored.

mmm...

Ok here new suggestions :P.

This will be useful for admins that likes banning players >:D.
* IsIpBanned( string? )
Checks the ban list for the entered ip and returns true or false. E.g. if i banned 127.0.0.1 and type /c isbanned 127.0.0.1 will return TRUE... But typing only 127.0 will returns false :P.

This can be used as an alternative form for respawning vehicle
* vehicle.StartPos
Returns or sets the vehicle pos to his originally from the Server.conf.
One time i entered the server and i said "WTF". All cars were placed in a line [yeah i have done a spawnall x/y/z command]. But the angles from cars were different [not always 0^ like in VCMP] and a few cars werent in the line... Everytime i joined an empty server the car were in a line. I have done the respawn stuff, every vehicle got his right pos, but if the server was again empty, vehicles has auto moved back! :(.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: jansi on October 11, 2009, 02:10:00 am
Hello!
These suggestions goes as well to the LU but since VCMP server is where I can work with the squirrel, i'm posting it here :p

It would be nice to have:

1. A way to split the script in many smaller files instead of keeping it all in one huge file.
I have a class that is used by the main script and I'd like to keep this class in a separate file, but if I do this:
Code: [Select]
<script>myclass.nut</script>
<script>myscript.nut</script>
the main script refuses to work (specifically the functions that are using this class). It looks like scripts doesn't 'see' each other.

2. Ability to connect squirrel scripts to remote servers - the same principle as it is now with mirc scripts:
[ Location A: Some computer + Script X ] ----> [ Location B: Server (+ optional Script Y) ]
I know about the .dll for mirc and this server but... that's not for squirrel :p

3. Currently not so important in my eyes: loading/unloading scripts dynamically (without changing server.conf).
Like, if today is wednesday (or the weather is rainy) i'm going to use Script1, but on the other days - Script2.
EDIT: With this it will be possible to reload scripts without restarting the server.


And if there is already a solution for any of these things, I'd like to hear them :]

EDIT: I've found something that looks like a small bug:
The server crashes if I use this script and type "asd " in the console (without the quotes and with exactly one space). If there are 2 or more spaces, everything is ok.
Code: [Select]
function onConsoleInput( cmd, text ) {
  if ( cmd == "asd" )
    if ( text )
      local a = split( text, " " );
}
And the funny thing is that these functions do the same thing, but doesn't crash the server.
Code: [Select]
function onPlayerChat( player, text ) {
  if ( text )
    local a = split( text, " " );
}
function onPlayerCommand( player, cmd, text ) {
  if ( cmd == "asd" )
    if ( text )
      local a = split( text, " " );
}
Title: Re: New VC:MP Server (With Squirrel!)
Post by: AdTec_224 on October 15, 2009, 04:55:33 am
Quote
1. A way to split the script in many smaller files instead of keeping it all in one huge file.
I have a class that is used by the main script and I'd like to keep this class in a separate file, but if I do this:

Code: [Select]
<script>myclass.nut</script>
<script>myscript.nut</script>

the main script refuses to work (specifically the functions that are using this class). It looks like scripts doesn't 'see' each other.

You can split scripts over multiple files using:

Code: [Select]
dofile( "Script.nut" );
An example would be:

Code: [Select]
function onScriptLoad( )
{
Print( "Example Script" );

dofile( "IRC.nut" );
}

Quote
2. Ability to connect squirrel scripts to remote servers - the same principle as it is now with mirc scripts:
[ Location A: Some computer + Script X ] ----> [ Location B: Server (+ optional Script Y) ]
I know about the .dll for mirc and this server but... that's not for squirrel :p

I think your missing the whole point, the idea in adding Squirrel to the server is for server-side scripting.

Quote
3. Currently not so important in my eyes: loading/unloading scripts dynamically (without changing server.conf).
Like, if today is wednesday (or the weather is rainy) i'm going to use Script1, but on the other days - Script2.
EDIT: With this it will be possible to reload scripts without restarting the server.

You can use "load_script <name>", "unload_script <name>" and finally "reload_scripts" (without quotes) all 3 commands you type directly like you do with "onConsoleInput" commands.

Hopefully i've answered most of your questions correctly.

- AdTec_224
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Juppi on December 03, 2009, 12:52:25 am
We've opened unofficial forums for the squirrel vcmp server and everything related to it - if you need help or want to release squirrel scripts for VC:MP pay a visit to http://forum.vicecitymultiplayer.info/ :)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Diavolo on December 03, 2009, 07:34:56 am
:O
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Juppi on January 24, 2010, 04:08:50 am
0.3z r2 server released -> clickety click (http://forum.vicecitymultiplayer.info/index.php?topic=2.msg43#msg43)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Mul_Tsafe on January 24, 2010, 10:30:42 pm
Good Luck, I am going to install VC then Ill try out the server
Title: Re: New VC:MP Server (With Squirrel!)
Post by: MarkWilson on January 29, 2010, 04:31:54 am
I am looking for the mIRC dll for the r2 squirrel server. Any help ?
Title: Re: New VC:MP Server (With Squirrel!)
Post by: mark on January 29, 2010, 08:24:28 am
I am looking for the mIRC dll for the r2 squirrel server. Any help ?


http://vicecitymultiplayer.info/files/vcmpmultidll-r2.zip
Title: Re: New VC:MP Server (With Squirrel!)
Post by: MexikanoS on March 02, 2010, 04:01:41 pm
Hmm. player.Angle works at that version of squirrel? Cause for me this function doesn't work.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Force on March 02, 2010, 04:56:59 pm
I'm not sure, I haven't tried it my self, there has been an R2 squirrel server release though so it might work on that.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: MexikanoS on March 03, 2010, 04:25:54 pm
Yh. It works only as "loading" using angle, but with that function we can't use as setting angle. Can you work on it?
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Force on March 03, 2010, 06:16:09 pm
I don't work on the server it's self but it would depend if VC:MP allows for the angle to be set. I know you can with vehicles, dunno about players though.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: MexikanoS on March 06, 2010, 01:23:15 pm
I got a problem with angle, trying to make !savepos command, but it ain't loading:

Code: [Select]
if ( cmd == "s" )
{
local pos = player.Pos;
WriteIniNumber( "Locations.ini", text, "x", pos.x );
WriteIniNumber( "Locations.ini", text, "y", pos.y );
WriteIniNumber( "Locations.ini", text, "z", pos.z );
WriteIniNumber( "Locations.ini", text, "angle", player.Vehicle.Angle );
MessagePlayer( "Lokacja o nazwie " + text + " zostala zapisana", player );
}

if ( cmd == "l" )
{
local x = ReadIniNumber( "Locations.ini", text, "x" ),
     y = ReadIniNumber( "Locations.ini", text, "y" ),
     z = ReadIniNumber( "Locations.ini", text, "z" );
 angle = ReadIniNumber( "Locations.ini", text, "angle" );
if ( x )
{
local pos = Vector( x, y, z );
local angle = angle;
player.Vehicle.Pos = pos;
player.Vehicle.Angle = angle;
 
MessagePlayer( "Teleportujesz sie do " + text + "...", player );
}
else MessagePlayer( "Lokacja " + text + " nie znaleziona", player );
}

Hmm?
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Force on March 06, 2010, 01:43:24 pm
Well for a start Number != Float, you trying to save a float to whats expecting a number so it ain't working.

Number: 1
Float: 1.1

Positions are sent and received as floats and so you need to save it as a float or do .tointeger() on it.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: mark on March 06, 2010, 08:23:18 pm
Hello,

i've got problem with function SetDrivebyEnabled,
Drive by is blocked, but M4 from sea sparrow and hunter works, only rockets from hunter has been blocked,
an it be fixed, in the next version of squirrel? Under my pleasements i'm giving photos of the bug (function SetDrivebyEnabled is Enabled).

(http://img532.imageshack.us/img532/9933/vcmp191.jpg)
(http://img63.imageshack.us/img63/9242/vcmp193.jpg)
Title: Re: New VC:MP Server (With Squirrel!)
Post by: MexikanoS on March 06, 2010, 08:28:56 pm
I was testing with him, anyway i have tested your .tointeger() and it still doesn't works.

[test]
x = -923.794
y = 648.333
z = 10.6049
angle = 45.6612
[q]
x = -833.339
y = -519.307
z = 10.5763
angle = 331.594
[luvforce]
x = -845.706
y = -484.191
z = 10.7787
angle = 16.7642
[testingangle]
x = -867.774
y = -473.339
z = 10.7885
angle = 72.5124
[blabla]
x = -882.893
y = -481.845
z = 12.7267
angle = 131.201

Here's saved cords, and here's code:

Code: [Select]
if ( cmd == "s" )
{
local pos = player.Pos;
WriteIniNumber( "Locations.ini", text, "x", pos.x );
WriteIniNumber( "Locations.ini", text, "y", pos.y );
WriteIniNumber( "Locations.ini", text, "z", pos.z );
WriteIniNumber( "Locations.ini", text, "angle", player.Vehicle.Angle );
MessagePlayer( "Lokacja o nazwie " + text + " zostala zapisana", player );
}

if ( cmd == "l" )
{
local x = ReadIniNumber( "Locations.ini", text, "x" ),
      y = ReadIniNumber( "Locations.ini", text, "y" ),
      z = ReadIniNumber( "Locations.ini", text, "z" );
  angle = ReadIniNumber( "Locations.ini", text, "angle" );
if ( x )
{
local pos = Vector( x, y, z );
local angle = angle;
player.Vehicle.Angle = angle.tointeger();
 
MessagePlayer( "Teleportujesz sie do " + text + "...", player );
}
else MessagePlayer( "Lokacja " + text + " nie znaleziona", player );
}

It just wont load.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Javi on March 17, 2010, 03:19:11 pm
mark, as far as I know the Hunter's and Sparrow's cannons don't fit as drive-by.

MexikanoS, I have noticed a couple of bugs in your script, and I felt free to code one for you.

Code: [Select]
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "s" )
{
WriteIniNumber( "Gotolocs.ini", text, "x", player.Pos.x );
WriteIniNumber( "Gotolocs.ini", text, "y", player.Pos.y );
WriteIniNumber( "Gotolocs.ini", text, "z", player.Pos.z );

PrivMessage( "Saved location: " + text, player );
}

else if ( cmd == "l" )
{
local x = ReadIniNumber( "Gotolocs.ini", text, "x" ),
 y = ReadIniNumber( "Gotolocs.ini", text, "y" ),
 z = ReadIniNumber( "Gotolocs.ini", text, "z" );

if ( x ) {
local pos = Vector( x, y, z );
player.Pos = pos;

PrivMessage( "Teleporting you to location: " + text, player );
}

else PrivMessage( "Location '" + text + "' does not exist.", player );
}
}

PS: I haven't tested the script, but it should work.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: MexikanoS on March 17, 2010, 07:10:57 pm
Nice that you get it from Wiki of Squirrel. Anyway it doesn't save angle, so gtfo.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Sephiroth on March 17, 2010, 07:33:23 pm
mark, as far as I know the Hunter's and Sparrow's cannons don't fit as drive-by.

MexikanoS, I have noticed a couple of bugs in your script, and I felt free to code one for you.

Code: [Select]
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "s" )
{
WriteIniNumber( "Gotolocs.ini", text, "x", player.Pos.x );
WriteIniNumber( "Gotolocs.ini", text, "y", player.Pos.y );
WriteIniNumber( "Gotolocs.ini", text, "z", player.Pos.z );

PrivMessage( "Saved location: " + text, player );
}

else if ( cmd == "l" )
{
local x = ReadIniNumber( "Gotolocs.ini", text, "x" ),
  y = ReadIniNumber( "Gotolocs.ini", text, "y" ),
  z = ReadIniNumber( "Gotolocs.ini", text, "z" );

if ( x ) {
local pos = Vector( x, y, z );
player.Pos = pos;

PrivMessage( "Teleporting you to location: " + text, player );
}

else PrivMessage( "Location '" + text + "' does not exist.", player );
}
}

PS: I haven't tested the script, but it should work.

Nice that you get it from Wiki of Squirrel. Anyway it doesn't save angle, so gtfo.

quoting because rape occured.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Javi on March 17, 2010, 07:44:16 pm
MexicanoS, just to let you know: I've scripted that command for you, I swear I haven't stolen it from anywhere. Also I noticed that the angle thing was kinda useless and had to take a closer look into it and I couldn't be arsed to include it, this was just a template so you could see the bugs in your past command. By the way, you are welcome :)

KTHXBAI
Title: Re: New VC:MP Server (With Squirrel!)
Post by: MexikanoS on March 27, 2010, 07:09:26 pm
I already know, that Squirrel Makers, or VC:MP Company don't completely makes the Vehicle Angle function.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Sephiroth on March 29, 2010, 05:24:37 am
I already know, that Squirrel Makers, or VC:MP Company don't completely makes the Vehicle Angle function.

lolwut
Title: Re: New VC:MP Server (With Squirrel!)
Post by: MexikanoS on April 06, 2010, 10:44:52 pm
I already know, that Squirrel Makers, or VC:MP Company don't completely makes the Vehicle Angle function.

lolwut

Lolwut? Man, VC:MP Scripters already did angle setting (works -tested with server :D), and with squirrel it doesn't works, so squirrel company did something wrong.
Title: Re: New VC:MP Server (With Squirrel!)
Post by: Windlord on April 07, 2010, 12:07:18 am
The vcmp devs didn't have to decipher unreadable code to create a func to fit into more unreadable code though.

There's a reason LU has vehicle angles before even releasing 0.1 and vcmp only has it now.

Remember, Juppi and VRocker are LU devs.