SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/05/2018, 01:37 PM   #1
Astonish
Big Clucker
 
Join Date: Aug 2017
Posts: 92
Reputation: 0
Default NPC wont connect

i am using a airplane filterscript but when i connect npc they get kicked
Attempting to connect NPC!

[06:31:32] SYSTEM: [BOT]Skimmer has been kicked - Vehicle Hacks(Controlling/TPing into cars)

under
public OnPlayerSpawn(playerid)
{
#if dbg-callbacks
format(query, sizeof(query), "DBG: OnPlayerSpawn(%d)",playerid);
SendClientMessageToAll(X11_YELLOW, query);
#endif
if(!IsPlayerNPC(playerid)) {
if(!IsPlayerConnectEx(playerid)) {
Kick(playerid);
Astonish is offline   Reply With Quote
Old 15/05/2018, 01:43 PM   #2
kovac
Banned
 
Join Date: Mar 2018
Posts: 182
Reputation: 14
Default Re: NPC wont connect

Simply make an exception in your anti-cheat system

PHP Code:
if(!IsPlayerNPC(playerid))
{
// not a NPC

kovac is offline   Reply With Quote
Old 15/05/2018, 01:45 PM   #3
Astonish
Big Clucker
 
Join Date: Aug 2017
Posts: 92
Reputation: 0
Default Re: NPC wont connect

its like this under
public OnPlayerSpawn(playerid)
{
#if dbg-callbacks
format(query, sizeof(query), "DBG: OnPlayerSpawn(%d)",playerid);
SendClientMessageToAll(X11_YELLOW, query);
#endif
if(!IsPlayerNPC(playerid)) {
if(!IsPlayerConnectEx(playerid)) {
Kick(playerid);
Astonish is offline   Reply With Quote
Old 15/05/2018, 01:54 PM   #4
Astonish
Big Clucker
 
Join Date: Aug 2017
Posts: 92
Reputation: 0
Default Re: NPC wont connect

Code:
acCarCheck(playerid) {
	if(IsPlayerInAnyVehicle(playerid)) {
		new seat = GetPlayerVehicleSeat(playerid);
		new c = GetPlayerVehicleID(playerid);
		if(PlayerOwnsCar(c,playerid)) return 1;
		if(currentCar[playerid][0] != c) {
			hackKick(playerid, "Vehicle Hacks(Controlling/TPing into cars)", "Vehicle Hacks");
		} else if(seat == 0 && currentCar[playerid][1] != 0 && seat != 128) {
			hackKick(playerid, "Vehicle Hacks(Controlling from passenger)", "Vehicle Hacks");
		}
	} else if(currentCar[playerid][0] != 0 && currentCar[playerid][2] < 1) {
			currentCar[playerid][0] = 0;
	}
	return 1;
}
here is a piece of code from anti cheat
Astonish is offline   Reply With Quote
Old 15/05/2018, 04:24 PM   #5
kovac
Banned
 
Join Date: Mar 2018
Posts: 182
Reputation: 14
Default Re: NPC wont connect

Make an exception for NPCs inside the anti cheat function.
kovac is offline   Reply With Quote
Old 15/05/2018, 04:35 PM   #6
Astonish
Big Clucker
 
Join Date: Aug 2017
Posts: 92
Reputation: 0
Default Re: NPC wont connect

Okay so now they connect but they wont move
Astonish is offline   Reply With Quote
Old 15/05/2018, 04:51 PM   #7
GTLS
Gangsta
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 817
Reputation: 91
Default Re: NPC wont connect

Code:
 if(IsPlayerNPC(playerid)) return 1;
Add that.. might work out?
__________________

I don't help for rep. I help cuz I was helped in the past.


California State Roleplay - X Update Now under beta testing phase. Stay Tuned.
GTLS is offline   Reply With Quote
Old 15/05/2018, 05:03 PM   #8
Astonish
Big Clucker
 
Join Date: Aug 2017
Posts: 92
Reputation: 0
Default Re: NPC wont connect

Still not idk why they dont do the functions they should do just stuck no movement
Astonish is offline   Reply With Quote
Old 15/05/2018, 05:44 PM   #9
OsmanMalagic
Big Clucker
 
Join Date: Jul 2016
Location: EX-YU
Posts: 57
Reputation: 48
Default Re: NPC wont connect

Quote:
Originally Posted by Astonish View Post
Okay so now they connect but they wont move
You must use this
PHP Code:
FCNPC_StartPlayingPlayback(npcid"driving"); 
// driving was example, you must set the name of your file.
OsmanMalagic is offline   Reply With Quote
Old 15/05/2018, 05:59 PM   #10
Sew_Sumi
Godfather
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,350
Reputation: 522
Default Re: NPC wont connect

Quote:
Originally Posted by OsmanMalagic View Post
You must use this
Are you sure though that they are using FCNPC though?
Sew_Sumi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NPC wont connect MayaEU Scripting Help 4 26/07/2016 10:34 AM
SA-MP wont Connect! yonis311 Client Support 14 25/05/2012 05:23 PM
npc's wont connect mysteryboyee Server Support 0 03/02/2012 06:32 PM
NPC's Wont even Connect Matthew_Johnston Server Support 5 21/01/2011 08:06 AM
NPC wont connect in RC-5? International Help Archive 7 13/09/2009 08:36 PM


All times are GMT. The time now is 11:11 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.