Show Posts
|
Pages: [1]
|
1
|
Scripting / Script Snippets / Detecting player AFK time
|
on: July 30, 2014, 02:26:33 pm
|
Time <- array ( GetMaxPlayers ( ), 0 ); // Set by default all the array to 0 with size of the MaxPlrs Name <- array ( GetMaxPlayers ( ), null ); // Store the names
function onScriptLoad ( ) {
NewTimer ( "IncreaseAllAFK", 1000, 0 ); }
function IncreaseAllAFK ( ) {
local Players = GetPlayers ( ) + 5; // If one player left with ID 1 and exists another with ID 2, increase +5 the player count
for ( local i = 0; i < Players; i ++ ) {
if ( FindPlayer ( i ) ) {
Time [ FindPlayer ( i ).ID ] ++; // Increase AFK time
if ( Time [ FindPlayer ( i ).ID ] >= 30 ) {
local Colname = FindPlayer ( i ).ColouredName;
if ( Colname.find ( "[AFK]" ) == null ) {
Name [ FindPlayer ( i ).ID ] = FindPlayer ( i ).ColouredName;
FindPlayer ( i ).ColouredName = Colname + " [#ffffff][AFK]"; } }
// Kicks after 7 minutes
if ( Time [ FindPlayer ( i ).ID ] >= 420 ) {
MessagePlayer ( "You was kicked by AFK limit time. [ 7 minutes ]", FindPlayer ( i ) );
KickPlayer ( FindPlayer ( i ) ); } } } }
// Check if a key was pressed:
function onPlayerKeyStateChange ( pPlayer, Key, Pressed ) { if ( Time [ pPlayer.ID ] >= 30 ) {
MessagePlayer ( "You were AFK for " + Time [ pPlayer.ID ] + " seconds. ", pPlayer ); // Show time
Time [ pPlayer.ID ] = 0;
pPlayer.ColouredName = Name [ pPlayer.ID ];
return; }
Time [ pPlayer.ID ] = 0; }
P.S. : I forgot some things.
|
|
|
2
|
Liberty Unleashed / Support / Linux bug
|
on: June 11, 2014, 11:27:19 pm
|
Hi again.
I having the next problem: When I starts the server on Linux, and I try to connect to the server, I can't by lag, always CONNECTING TO [..], and when I wait some minutes, works normally, showing the messages of the connection (with lag).
With my other own server and Windows this don't occurs, only Linux.
I TRIED: Rebooting the VPS, removing timers, removing the object for duels, checking "onScriptLoad". -> Nope
|
|
|
3
|
Liberty Unleashed / Suggestions / List of suggestions & bugs
|
on: June 06, 2014, 12:17:03 am
|
Add.· Check if the player have MP3 sounds (e.g. CheckMP3Folder ( player ) ) With file class is possible. · Enable or disable CallServerFunc (e.g. DisableClientCall ( true/false ) ) · If the client script is already created, without edit, ignore. Check if the player have other script or be old & re-download. · Add command log. · Disable the logs in server config. · Event: onConsoleSay · Up allowable characters · Clear any weapons, and not all. (Player.ClearWeapon(weaponid)) · Fix event: onPlayerWeaponChange · Add more of 100 of HP and armour (Why not? Perfect for TDM!) · Event: onServerCrash Squirrel problems... fu! · * Function: Player.Sprint (bool) (For RPG!) · * Function: Vehicle.Weight · * Function: SetInvisibleCheat ( bool ) · * Function: Player.WeaponShake ( float ) (When the player aim with m16 and shoots, i have here the address, if is need) · * Function: Player.Blood ( bool ) (Address here haha, enable/disable blood)
Bugs.· When the garages are opening or closing, and you type /reconnect, are stopped. · When the garages are opened, when you type /reconnect, are closed
· Fix skins from 26 to 29. (This is not a bug, 26-29, 122 - [the result of 26-29], GTA3 skins) · Fix vehicles bug entering. ( *.ExitVehicle function and try to enter, bugged car ) · With timer + open + close garage door + while + bool = BUG (I lost the code, sorry, I can't post..) · Cash bug, with reconnect the cash don't reset to 0. You need reset this via scripts when the player connects. · s19 -> If try to return r, g or b value from Colour, it will return only r value.
Crashes.· When the player receives the client files, crash, but is when the NUT is created, if already exists the nut with other code or not, don't crash.
· * New
|
|
|
5
|
Scripting / Script Help / Get Pickup pos and spawn from db
|
on: December 28, 2013, 10:59:43 pm
|
Hi,
I have a problem getting the position and spawn the pickups for the properties. When the server call the function, the pickups in the server doesn't spawn. It does not give me any errors.
Here the function:
function LoadProps() { if ( CountProps() != 0 ) { local q = sqlite_query( db, "SELECT * FROM Properties WHERE ID='%'" ), pos; while ( sqlite_column_data( q, 0 ) ) { local coords = sqlite_column_data( q, 5 ); CreatePickup( 1361, Vector( GetTok( coords, " ", 1 ).tofloat(), GetTok( coords, " ", 2 ).tofloat(), GetTok( coords, " ", 3 ).tofloat() ) ); sqlite_next_row( q ); } sqlite_free( q ); } }
I'm newbie in SQLite...
|
|
|
6
|
Scripting / Script Help / Player and vehicle
|
on: December 09, 2013, 10:50:47 pm
|
How I can put the player in the vehicle when I spawn the vehicle?
I tried this:
else if ( cmd == "v" || cmd == "veh" || cmd == "car" ) { if ( plr.Spawned ) { if ( arguments ) { if ( IsNum( arguments ) ) { local pTemp = split( arguments, " " ), ID = 90; if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger(); if ( ( ID >= 90 ) && ( ID <= 150 ) ) { local v = plr.Pos; local pVehicle = CreateVehicle( ID, Vector( v.x, v.y, v.z ), plr.Angle ); pVehicle.OneTime = true; local Fv = FindVehicle( pVehicle ); plr.Pos = Fv.Pos; plr.EnterVehicle( DOOR_DRIVER, Fv ); } } else MessagePlayer( "Invalid arguments. Usage: /" + cmd + " < ID >", plr, 250, 0, 0 ); } else MessagePlayer( "Invalid arguments. Usage: /" + cmd + " < ID >", plr, 250, 0, 0 ); } else MessagePlayer( "You first need spawn.", plr, 250, 0, 0 ); return true; }
But doesn't work.
|
|
|
8
|
Scripting / Script Help / Save Pos.
|
on: September 02, 2013, 01:57:40 pm
|
What is wrong ?
function InitStatsTimer( plr ) { local pos = plr.Pos; local health = plr.Health; local armour = plr.Armour; local FormatPos = format( pos.x + "," + pos.y + "," + pos.z ); local FormatWeapon = format( plr.Weapon + "," + plr.WeaponAmmo ); SetHealth( plr.Name, health ); SetArmour( plr.Name, armour ); SetWeapon( plr.Name, FormatWeapon ); SetPosition( plr.Name, FormatPos ); SaveStatHashes(); }
function ProcessPlayerStatsLog( plr ) { plr.Health = GetHealth( plr.Name ); plr.Armour = GetArmour( plr.Name ); plr.SetWeapon( GetWeapon( plr.Name ) ); plr.Pos = Vector( GetPosition( plr.Name ) ); if ( !plr.Spawned ) plr.Spawn(); }
Say error in
plr.Pos = Vector( GetPosition( plr.Name ) );
Lol.
|
|
|
12
|
Scripting / Script Help / Not load Script MessAbout (Question in Spanish/English)
|
on: March 15, 2013, 07:30:33 pm
|
Spanish:
Bueno, la verdad es que no se como hacer que cargue el MessAbout (tengo 14 scripts puestos) con la velocidad (GameSpeed) y demás pero no me funciona extrañamente.Uso el FBS y cuando lo quito tampoco funciona.Además ayudarme como hacer que funcione el comando SpawnCar que tampoco me funciona.Gracias de Ant3mano.
English:
Well, the truth is that not as doing that it loads the MessAbout (I have 14 scripts positions) with the speed (GameSpeed) and others but it me does not work strangly. I use the FBS and when I do not remove either it it works. In addition to help myself like to do that there works the command SpawnCar that me does not work either.
|
|
|
|