npc crash
#1

hello guys can you help me put the reconnect code in this so my npcs spawn and dont crash after onplayerconnect or disconnect lol

if(IsPlayerNPC(playerid))
{
SpawnPlayer(playerid);
return 1;
}
Reply
#2

This code is wrongly defined, You must do that at OnPlayerSpawn callback, and SpawnPlayer OnPlayerConnect? I actually think too it would crash you, because if you spawn the player OnPlayerConnect who will put him in vehicle lol? Try it OnPlayerSpawn.
Reply
#3

Maybe under OnPlayerRequestSpawn?
Reply
#4

I did not got what you want from us.
Reply
#5

ok on player spawn lol sorry my bad this is what i got

if(IsPlayerNPC(playerid)) return 1;
Reply
#6

EDIT: My fault
Reply
#7

ok i changed this part of the npc code and they spawn now but seem to teleport around rather than walk

from this
if(IsPlayerConnected(i) && !IsPlayerNPC(i))

to this
if(IsPlayerConnected(i) && !IsPlayerNPC(0))
seems to have worked maybe
Reply
#8

Do you even do at the right way?

If not, read kc's tutorial more carefully and you will get it.
Reply
#9

it was the anti cheat and yea it was turned off on requestclass so 0 turns it on if im not wrong idk im a newb
they are still teleporting around though lol
Reply
#10

But the main problem is fixed?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)