Bugs:
1. Split returns an array error :@
This was an example from Squirrel's web page
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
In this example, it was a kick when the Nickname is a number. My code:
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.
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...
And sometimes, the player is flying in the air (classic vcmp bug).
player.Health = ( player.Health - 20 );
4. Small spelling bugs:
From the get weapon name from id:
id 32 returns m60, should be
M60
id 30 was probably Rocketlauncer, should be Rocket Launcher
5. Counting players on player part
If im leaving the server, then it's empty
. 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:
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 :/.
local max = 10;
local asd = (rand() % max) + NUMBER;
2. Again Squirrels web page:
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
? 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]:
<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
? Maybe also action key?
Thx for reading
Edited this post 20 times or more