Vice City: Multiplayer

VC:MP Discussion => Bugs and Crashes => Support => Closed Bug Reports => Topic started by: Mariu22S on Jan 24, 2015, 09:53 AM

Title: Pickup Problem / Segmentation fault
Post by: Mariu22S on Jan 24, 2015, 09:53 AM
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
Title: Re: Pickup Problem / Segmentation fault
Post by: Gudio on Jan 24, 2015, 11:16 AM
A po polsku? Masz jakąś obsługę do claim pickup i pickedup?
Przed chwilą to sprawdziłem i nie mam żadnego problemu.
Title: Re: Pickup Problem / Segmentation fault
Post by: Mariu22S on Jan 24, 2015, 11:51 AM
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ą
Title: Re: Pickup Problem / Segmentation fault
Post by: Gudio on Jan 24, 2015, 11:59 AM
Ż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.
Title: Re: Pickup Problem / Segmentation fault
Post by: . on Jan 24, 2015, 12:08 PM
No offense but I thought this was an English forum? How can someone with the same issue understand anything in the future?
Title: Re: Pickup Problem / Segmentation fault
Post by: Gudio on Jan 24, 2015, 12:12 PM
Don't worry, I will explain it when the problem is solved.
Title: Re: Pickup Problem / Segmentation fault
Post by: Mariu22S on Jan 24, 2015, 12:31 PM
Nadal jest błąd wejdź na serwer PS hasło ; niewiem50
Title: Re: Pickup Problem / Segmentation fault
Post by: Gudio on Jan 24, 2015, 12:37 PM
Wiem o co chodzi. Poprawiam w źródłach. :P
Title: Re: Pickup Problem / Segmentation fault
Post by: Mariu22S on Jan 24, 2015, 12:57 PM
:)

Będzie można gdzieś skompilować update modułu/serwera ?
Title: Re: Pickup Problem / Segmentation fault
Post by: Gudio on Jan 24, 2015, 01:10 PM
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));
Title: Re: Pickup Problem / Segmentation fault
Post by: Mariu22S on Jan 24, 2015, 01:20 PM
Wszystko działa. Dzięki

Everything works
Title: Re: Pickup Problem / Segmentation fault
Post by: . on Jan 24, 2015, 01:25 PM
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);
Title: Re: Pickup Problem / Segmentation fault
Post by: Gudio on Jan 24, 2015, 01:29 PM
You can't pass instances via timer atm.
Title: Re: Pickup Problem / Segmentation fault
Post by: Stormeus on Feb 16, 2015, 11:14 PM
Semi-resolved. Duplicate of an existing bug.

https://bitbucket.org/stormeus/0.4-squirrel/issue/9/some-types-of-data-crash-timers