Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Gudio

#1
It happens often on my racing server. I set HP for players in callbacks like exit vehicle. To avoid this I must use '-noanticheat' parameter.
Kicking player '[DnA]Gudio' (0), health increased from 93 to 100.
#2
Sometimes I can enter 5 checkpoints and then the server is crashed.
My script removes current CP and immediately creates a new one. I guess that's the reason.

Program received signal SIGSEGV, Segmentation fault.
0x08055264 in ?? ()
(gdb) backtrace
#0  0x08055264 in ?? ()
#1  0x08054c76 in ?? ()
#2  0x080ef958 in ?? ()
#3  0x080ef8fb in ?? ()
#4  0x080ef777 in ?? ()
#5  0x0804e486 in ?? ()
#6  0x0804cec5 in ?? ()
#7  0xb7d3be46 in __libc_start_main (main=0x804cc9d, argc=1, ubp_av=0xbffff7b4, init=0x80f0ec0, fini=0x80f0eb0, rtld_fini=0xb7ff0590, stack_end=0xbffff7ac) at libc-start.c:244
#8  0x0804aa21 in ?? ()
(gdb)
#4
Snippet Showroom / Weapon pickups after kill
Apr 14, 2015, 07:35 AM
Requested by @4kUM45 and @Gulk.

First of all we need a function called random which accepts minimum and maximum values in its parameters:
function random( min, max )
{
if ( min < max )
return rand() % (max - min + 1) + min.tointeger();
else if ( min > max )
return rand() % (min - max + 1) + max.tointeger();
else if ( min == max )
return min.tointeger();
}

then we must add a table responsible for deleting pickups when they're picked up:
wepPickups <- {};
next we need a function which will be used in onPlayerDeath/onPlayerKill/onPlayerTeamKill events. (DIY)
function CreatePlayerWeaponPickups( player )
{
for ( local i = 0, world, pos, pickup, weapon; i < 7; i++ )
{
world = player.World;
weapon = player.GetWeaponAtSlot( i );
player.World = player.UniqueWorld;

if ( weapon > 0 && weapon != 16 )
{
pos = player.Pos;
pos.x = random( pos.x - 2, pos.x + 2 );
pos.y = random( pos.y - 2, pos.y + 2 );

pickup = CreatePickup( 258 + weapon, world, player.GetAmmoAtSlot( i ), pos, 255, true );
if ( pickup )
wepPickups.rawset( pickup.ID, pickup );
}
}
}

finally, onPlayerClaimPickup must return true:
function onPickupClaimPicked( player, pickup )
{
if ( player.Health > 0 && wepPickups.rawin( pickup.ID ) )
{
PlaySound( player.UniqueWorld, 78, player.Pos );

wepPickups.rawdelete( pickup.ID );
pickup.Remove();

return 1;
}

return 0;
}

_/
Feel free to add a timer to delete pickups after some time.
#5
Snippet Showroom / [Function] getPressedKeys
Jan 19, 2015, 02:32 PM
Since onPlayerGameKeysChange callback has been added to 0.4's squirrel module, you can write for example a nice spectator mode with sprites or textdraws that show what keys are pressed by the player at the moment.
Function is provided below:

onfoot <- [ KEY_ONFOOT_FORWARD, KEY_ONFOOT_BACKWARD, KEY_ONFOOT_LEFT, KEY_ONFOOT_RIGHT, KEY_ONFOOT_JUMP, KEY_ONFOOT_SPRINT, KEY_ONFOOT_FIRE, KEY_ONFOOT_CROUCH, KEY_ONFOOT_PUNCH, KEY_ONFOOT_PREVWEP, KEY_ONFOOT_NEXTWEP, KEY_ONFOOT_AIM ];
incar <- [ KEY_INCAR_LEFT, KEY_INCAR_RIGHT, KEY_INCAR_BACKWARD, KEY_INCAR_FORWARD, KEY_INCAR_HORN, KEY_INCAR_LEANUP, KEY_INCAR_LEANDOWN, KEY_INCAR_LOOKLEFT, KEY_INCAR_LOOKRIGHT ];


function getPressedKeys( keysFlag, isOnFoot )
{
local table, pressedKeys = {}, i = 0;


if ( isOnFoot )
table = onfoot;
else
table = incar;


foreach ( key in table )
{
if ( key <= keysFlag )
{
pressedKeys.rawset( i++, key );
keysFlag -= key;
}
}


return pressedKeys;
}

Have fun and grab the latest version of squirrel module here.
#6
This issue was reported by me like a year ago to maxorator and I thought he fixed it, but today I've noticed the same again.
Removed pickups sometimes are still visible on the screen, but on the server-side they don't exist anymore. They aren't rotating and have strange alpha.

I have recorded it, so you will understand what I was talking about.
https://www.youtube.com/watch?v=6e3OD4Htu5I
#7
Closed Bug Reports / Ghost Vehicles
Nov 08, 2014, 10:51 AM
Last update fucked up ghost vehicles. When there is a driver in the car, ghost state doesn't work and all collisions are enabled.