[ FCNPC ] - On Disconnect

Započeo noddy_, Novembar 05, 2021, 17:30:35 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Nema errora pa ni warninga, vec kad ubijem FCNPC-a izbaci "Ime_ID"  je napustio server, pusteni ste, mod koji koristim Miami Street by V01D
Deo skripte: [pawn]if( DragedPlayerID[ playerid ] != -1 ) {

      format( globalstring, sizeof( globalstring ), "%s je napustio server, pusteni ste.", ImeIgraca( playerid ) );
      SCM( DragedPlayerID[ playerid ], -1, globalstring );
      TogglePlayerControllable( DragedPlayerID[ playerid ], 1 );
      Draged[ DragedPlayerID[ playerid ] ] = -1;
   }[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): Run time error 4: "Array index out of bounds"
[debug]  Attempted to read/write array element at negative index -2
[debug] AMX backtrace:
[debug] #0 00490bc8 in public ppb_OnPlayerDisconnect (playerid=0, reason=1) at C:\Users\Hp\Desktop\D I N O\DEV\PAWNO\Miami House - OGC\gamemodes\main.pwn:25151
[debug] #1 0005123c in public CB_OnPlayerDisconnect (playerid=0, reason=1) at C:\Users\Hp\Desktop\D I N O\DEV\PAWNO\Miami House - OGC\LeksaCompiler\include\progress2.inc:336
[debug] #2 00043efc in public Itter_OnPlayerDisconnect (playerid=0, reason=1) at C:\Users\Hp\Desktop\D I N O\DEV\PAWNO\Miami House - OGC\LeksaCompiler\include\newsamp.inc:422
[debug] #3 native CallLocalFunction () from samp-server.exe
[debug] #4 000404f4 in ?? (... <2 arguments>) at C:\Users\Hp\Desktop\D I N O\DEV\PAWNO\Miami House - OGC\LeksaCompiler\include\foreach.inc:787
[debug] #5 00032004 in public SSCANF_OnPlayerDisconnect (playerid=0, reason=1) at C:\Users\Hp\Desktop\D I N O\DEV\PAWNO\Miami House - OGC\LeksaCompiler\include\YSI\y_hooks/impl.inc:682
[debug] #6 00023cf0 in public WC_OnPlayerDisconnect (playerid=0, reason=1) at C:\Users\Hp\Desktop\D I N O\DEV\PAWNO\Miami House - OGC\LeksaCompiler\include\sscanf2.inc:229
[debug] #7 00007ec0 in public OnPlayerDisconnect (playerid=0, reason=1) at C:\Users\Hp\Desktop\D I N O\DEV\PAWNO\Miami House - OGC\LeksaCompiler\include\weapon-config.inc:2164
[part] Dino has left the server (0:1)


Hvala koji mogu pomoci :D
Poslednja Izmena: Novembar 06, 2021, 01:45:17 PRE PODNE od M Ө M Σ N Z I
SPEED HACK (C++) https://github.com/nouddy/samp-speed-hack
Reliant GameMode (open.mp) https://github.com/nouddy/reliant-omp
SA:MP Landing Page https://github.com/nouddy/samp-landing-page


Kolko drama ima u 7 grama

[pawn]public OnPlayerDisconnect(playerid, reason) {

   if(IsPlayerNPC(playerid)) return 1;

   return 1;
}[/pawn]

Dodaj na sami pocetak callback-a OnPlayerDisconnect, takodje ces morati na neke klasicne stvari, OnPlayerDeath, OnPlayerSpawn, OnPlayerRequestSpawn, OnPlayerRequestClass, OnPlayerConnect i takodje na pocetku svakog ptask timera ( ako koristis y_timers )