Show Posts
|
Pages: 1 [2] 3 4 ... 7
|
16
|
Scripting / Script Releases / Re: [Update 29-09] GUI Admin Panel
|
on: October 05, 2014, 04:18:44 pm
|
There's security flaw in your script. Anybody with client exploit can control the server w/ admin on it.
I suggest to add one more parametr to CallServerFunc. Special key/code, what admin of server receives on join. Or it can be any other check.
|
|
|
17
|
Liberty Unleashed / Bug Reports / Re: Liberty Unleashed Issues List [0.1.0.16]
|
on: September 24, 2014, 01:53:46 am
|
- Colour class still returns just r value, even if you request it g or b or a
- GetHUDItemEnabled is also bugged and doesn't returns right bool
That's all what I remembered. Add PARTREASON_RECONNECT (feature #3) (idea by sasha19323)
It doesn't work anymore.
|
|
|
21
|
Scripting / Script Snippets / Pseudo 3D sound
|
on: August 31, 2014, 03:06:03 pm
|
This script would be good for Survival/RP gamemodes. You can create it via server(e.g CallClientFunc(plr, null, "PosSound", "track.mp3", Vector(0,0,0), 50); ) or via client(onScriptLoad event or commands). Don't forget to add the sounds in your script.xml file. pSounds <- [];
const MAX_RADIUS = 127; //maximal volume class PosSound { constructor(name, pos, r) { Pos = pos; Name = name; Radius = r; Sound = ::FindSound(name); if (Sound) { Sound.Open(); ::pSounds.push(this); } else this.clear(); }
function Play() { if (Sound) { if (IsPlaying == false) { Sound.Play(); IsPlaying = true; } } } function Stop() { if (Sound) { if (IsPlaying == true) { Sound.Stop(); IsPlaying = false; } } } function Pause() { if (Sound) { if (IsPlaying == true) { Sound.Pause(); IsPlaying = false; } } }
Name = ""; Pos = Vector(0,0,0); Radius = 127; Sound = null; IsPlaying = false; }
pPlayer <- FindLocalPlayer(); function onClientRender() { for (local i = 0; i < pSounds.len(); i++) { local dist = GetDistance(pPlayer.Pos, pSounds[i].Pos).tointeger(); if (dist <= pSounds[i].Radius) { pSounds[i].Sound.SetVolume(MAX_RADIUS/pSounds[i].Radius*(pSounds[i].Radius-dist)); if (!pSounds[i].IsPlaying) pSounds[i].Play(); } else { if (pSounds[i].IsPlaying) pSounds[i].Sound.SetVolume(0); //Pause doesn't work properly, so just setting volume to 0 } }
return 1; } PS: Video later today
|
|
|
25
|
Scripting / Script Snippets / MP3 files detection
|
on: July 17, 2014, 12:28:07 pm
|
This snippet based on MP3Report.txt file in "mp3" folder. Snippet parse the file and prevent the crash.
function FileReadLine(f) //f - file { local output = ""; local tmp; while(true) { tmp = f.readn('b'); if (tmp != '\n') { output += tmp.tochar(); } else { return output; } } } function onClientCommand(cmd, text) { switch(cmd) { case "radio": { if (text) { if (IsNum(text)) { local id = text.tointeger(); if (id >= 0 && id < 9) { PlayFrontEndTrack(id); } else if (id >= 9) { local f = file("mp3/MP3Report.txt", "r"); local line; if (f) { while(true) { local line = FileReadLine(f); if (typeof line.find("TOTAL SUPPORTED MP3s: ") != "null") { local count = line.slice(line.len()-1); if (count != "0") { PlayFrontEndTrack(9); break; } else { Message("[#ff0000]No MP3 files have been found"); break; } } } } else Message("[#ff0000]No MP3 files have been found"); } } } } return 0; } }
|
|
|
27
|
Liberty Unleashed / Suggestions / Re: List of suggestions & bugs
|
on: July 16, 2014, 11:36:31 pm
|
ยท * Event: onServerCrash
Lol, and how do you expect this to work? It's like requesting a dead person to tell his family he's dead. He can't, he's dead. Same goes with the server. It dies. You'd be happy if it was able to free up some memory before dying.
e.g. Exception Handler
|
|
|
29
|
Scripting / Script Snippets / Simple reconnected player detect
|
on: June 27, 2014, 08:04:10 pm
|
Just add this code on onScriptLoad client-side event:
try { HashTable("lalka"); //Here can be any name of table; } catch(e) { //if player has been reconnected Message("You have been kicked. Please type /q and join again", Colour(255, 0, 0)); CallServerFunc(null, "KickPlayer", FindLocalPlayer()); } This snippet will help you prevent some /reconnect bugs(objects removing etc).
|
|
|
|