[ FCNPC ] - On Disconnect

Započeo noddy_
5. Nov. 2021. Zaključano
388
pregleda
3
postova
D1NO
6
Crime Lord
5. Nov. 2021.
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:
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;
}

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
Run time error 4: "Array index out of bounds"
  Attempted to read/write array element at negative index -2
AMX backtrace:
#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
#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
#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
#3 native CallLocalFunction () from samp-server.exe
#4 000404f4 in ?? (... <2 arguments>) at C:\Users\Hp\Desktop\D I N O\DEV\PAWNO\Miami House - OGC\LeksaCompiler\include\foreach.inc:787
#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
#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
#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
Dino has left the server (0:1)


Hvala koji mogu pomoci 😄
Skrilew
6
Godfather
5. Nov. 2021.
public OnPlayerDisconnect(playerid, reason) {

if(IsPlayerNPC(playerid)) return 1;

return 1;
}


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 )
D1NO
6
Crime Lord
5. Nov. 2021.
Hvala <3

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha