NPC help
#1

Код:
[16:42:04] Incoming connection: 127.0.0.1:3291
[16:42:04] [npc:join] Taxi1 has joined the server (0:127.0.0.1)
[16:42:04] Incoming connection: 127.0.0.1:3292
[16:42:04] [npc:join] Taxi2 has joined the server (1:127.0.0.1)
[16:42:04] Incoming connection: 127.0.0.1:3293
[16:42:04] [npc:join] Taxi3 has joined the server (2:127.0.0.1)
[16:42:04] Incoming connection: 127.0.0.1:3294
[16:42:04] [npc:join] Taxi4 has joined the server (3:127.0.0.1)
[16:42:04] Incoming connection: 127.0.0.1:3295
[16:42:04] [npc:join] PoliceMan has joined the server (4:127.0.0.1)
[16:42:04] Incoming connection: 127.0.0.1:3296
[16:42:04] [npc:join] Sweeper has joined the server (5:127.0.0.1)
[16:42:04] Incoming connection: 127.0.0.1:3297
[16:42:04] [npc:join] PoliceBiker has joined the server (6:127.0.0.1)
[16:42:04] Incoming connection: 127.0.0.1:3298
[16:42:04] [npc:join] Pilot has joined the server (7:127.0.0.1)
[16:42:04] Incoming connection: 127.0.0.1:3299
[16:42:04] Incoming connection: 127.0.0.1:3300
[16:42:04] Incoming connection: 127.0.0.1:3304
[16:42:04] Incoming connection: 127.0.0.1:3305
[16:42:06] [npc:part] Taxi1 has left the server (0:2)
[16:42:06] [npc:part] Taxi2 has left the server (1:2)
[16:42:06] [npc:part] Taxi3 has left the server (2:2)
[16:42:06] [npc:part] Taxi4 has left the server (3:2)
[16:42:06] [npc:part] PoliceMan has left the server (4:2)
[16:42:06] [npc:part] Sweeper has left the server (5:2)
[16:42:06] [npc:part] PoliceBiker has left the server (6:2)
[16:42:06] [npc:part] Pilot has left the server (7:2)
Help but they have a NPC after 1 sec disconekt, what should I do? Server we have / login system which the NPC can do that in server?
Reply
#2

That would be caused by your login system. Open up the script, look for
pawn Код:
public OnPlayerConnect(playerid)
{
   //bunch of things here
Before that bunch of things, add [pawn]if(IsPlayerNPC(playerid)) return 1;[pawn]

That should fix it, remember to backup the script.
Reply
#3

Quote:
Originally Posted by Zeros
Help but they have a NPC after 1 sec disconekt, what should I do? Server we have / login system which the NPC can do that in server?
Read the common problems @ NPC tutorial topic.
Reply
#4

Are you able to stop writing in big red large text?

If your servers kicks if you don't login after a while, you could use:
Код:
// Blah blah code here

if(!IsPlayerNPC(playerid))
{
   // Code Here, this part is if the player -IS NOT- an NPC.
}
return 1;


// Blah blah code here
So if your login system REQUIRES login, I'm assuming you're using a timer, under the function that the timer is calling, add the above code, the code basicly checks if the player isn't an NPC.
Код:
 
IsPlayerNPC
returns 1 if the player IS an NPC, we are adding:
Код:
 
!
infront of
Код:
 
IsPlayerNPC
the ! basicly means "Not" in PAWN code.
So we're checking if the player's NOT an NPC, and if the function returns 1 (the player isn't an NPC) It will continue with the kick.
and if the player's IS an NPC, it will not kick.
If it isn't an NPC, then carry on with the code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)