SA-MP Forums Archive
NPC Crash server? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: NPC Crash server? (/showthread.php?tid=612824)



NPC Crash server? - DusanInfinity - 21.07.2016

When 1 player connect his NPC on server, server crash.
Log:
Код:
[23:36:07] [connection] 127.0.0.1:15808 requests connection cookie.
[23:36:08] [connection] incoming connection: 127.0.0.1:15808 id: 2
[23:36:08] [npc:join] NPC0_Husejin_Muharemovic has joined the server (2:127.0.0.1)
[23:36:08] NPC: Connection from 127.0.0.1 is allowed.
I think problem is in characters... Player's name 19 characters + NPC0_(5), and thats 24, could that crash the server?

EDIT: Crash detect says that this line makes problem:
Код:
format(strg,sizeof(strg),"NPC%d_%s",ii,GetName(i));



Re: NPC Crash server? - DTV - 21.07.2016

Well, the double i in the format would probably cause some problem.

pawn Код:
format(strg,sizeof(strg),"NPC%d_%s",i,GetName(i));