Pickup Problem / Segmentation fault

Started by Mariu22S, Jan 24, 2015, 09:53 AM

Previous topic - Next topic

Mariu22S

Hello.

I say once could not fault the script .Problem lies in the engine 0.4

Server down if the player with ID 0 comes up and has the pickup with him and the player with ID 1 will take it
The server console shows:  Segmentation fault

This video will show you how it happens

https://www.youtube.com/watch?v=dbhSf0F9x_w&feature=youtu.be

Tests for : Linux 32bit and Windows 32bit and Windows 64bit server on all version down/crash

Gudio

#1
A po polsku? Masz jakąś obsługę do claim pickup i pickedup?
Przed chwilą to sprawdziłem i nie mam żadnego problemu.

Mariu22S

#2
To jest funkcja która jest na onplayerpart

function ZgubWalizke( player )
{
    if ( Walizka[0] == player.ID )
   {
        CreatePickup( 335, Vector( ( player.Pos.x + 2 ), player.Pos.y, player.Pos.z ) );
      Walizka[0] = 999;
       ClientMessageToAll( "** Gracz:[ " + player.Name + " ] zgubil walizke w rejonie " + GetDistrictName( player.Pos.x, player.Pos.y ) + ".", 255, 182, 193 );
   }   
}

A w function onPickupClaimPicked( player, pickup )
              switch( pickup.Model )
             {
      case 508:
      Message( "[#ffffff][INFO][#D031DB] Gracz [#1FFFF9]" + player.Name + "[#D031DB] znalazl keycard. Gratulacje. :)" );
      player.Cash += 5000; stats[ player.ID ].Cash += 5000; stats[ player.ID ].KeyCard++; keycards--;
      PlaySound( 1 , 475 , player.Pos );
      pickup.Remove();
      break;
           }

Na wersji 0.3 nie było takiego problemu z tą funkcją

Gudio

Żeby onPickupPickedUp się wykonał, musisz w funkcji claim zwrócić 1. W onPickupPickedUp zrób usuwanie wiadomości i usuwanie pickupa, a w onPickupClaimPickup tylko sprawdzanie.

.

No offense but I thought this was an English forum? How can someone with the same issue understand anything in the future?
.

Gudio

Don't worry, I will explain it when the problem is solved.

Mariu22S

Nadal jest błąd wejdź na serwer PS hasło ; niewiem50

Gudio

Wiem o co chodzi. Poprawiam w źródłach. :P

Mariu22S

:)

Będzie można gdzieś skompilować update modułu/serwera ?

Gudio

Mariu22S creates a pickup everytime when player leaves the server. The problem happens with created pickup, because while removing it, the server immediately crashes. It's connected with removing and adding instances almost the same time.

The temporary solution for it is creating the pickup with NewTimer function that works well in 0.4.

@Mariu22S, w ZgubWalizke:
CreatePickup( 335, Vector( ( player.Pos.x + 2 ), player.Pos.y, player.Pos.z ) );na:
NewTimer("CreatePickupFix", 100, 1, 335, player.Pos.x, player.Pos.y, player.Pos.z );
Funkcja:
function CreatePickupFix(model, x, y, z) CreatePickup(model, Vector(x, y, z));

Mariu22S

Wszystko działa. Dzięki

Everything works

.

Quote from: Gudio on Jan 24, 2015, 01:10 PMThe temporary solution for it is creating the pickup with NewTimer function that works well in 0.4.

@Mariu22S, w ZgubWalizke:
CreatePickup( 335, Vector( ( player.Pos.x + 2 ), player.Pos.y, player.Pos.z ) );na:
NewTimer("CreatePickupFix", 100, 1, 335, player.Pos.x, player.Pos.y, player.Pos.z );
Funkcja:
function CreatePickupFix(model, x, y, z) CreatePickup(model, Vector(x, y, z));

AFAIK you should be able to use the CreatePickup function directly without using any proxies.
NewTimer("CreatePickup", 100, 1, 335, player.Pos);
.

Gudio

You can't pass instances via timer atm.

Stormeus