SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 08/11/2011, 02:14 PM   #1021
Setkus
Big Clucker
 
Setkus's Avatar
 
Join Date: Oct 2010
Location: Lithuania
Posts: 121
Reputation: 0
Default Re: Creating a new NPC

Please, help me... There is an anti ping, but how can i do that NPC bot doesnt get kick for ping?
__________________
Well, have a nice day!

Los Santos: 82.135.230.10:1111
Setkus is offline   Reply With Quote
Old 08/11/2011, 05:02 PM   #1022
Setkus
Big Clucker
 
Setkus's Avatar
 
Join Date: Oct 2010
Location: Lithuania
Posts: 121
Reputation: 0
Default Re: Creating a new NPC

Please, guys, help... I really need help!
__________________
Well, have a nice day!

Los Santos: 82.135.230.10:1111
Setkus is offline   Reply With Quote
Old 21/11/2011, 04:45 PM   #1023
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default Re: Creating a new NPC

Why I'm getting error that StartRecordingPlayback is undefined but I included a_npc )

@Setkus
Quote:
Originally Posted by kc View Post
My NPC leaves my server after it joins
Your script is forcing the NPC to login, or you have an anti-cheat / ping kicker that is interfering with your NPC. You can add...
pawn Code:
if(IsPlayerNPC(playerid)) return 1;
... as the first line of any callbacks that bots will use, e.g. OnPlayerRequestClass or OnPlayerRequestSpawn. For an efficient, simple way of excluding NPCs from loops, check out foreach by ******.
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 21/11/2011, 05:39 PM   #1024
Kostas'
High-roller
 
Kostas''s Avatar
 
Join Date: Sep 2011
Location: Athens, Greece
Posts: 1,063
Reputation: 101
Default Re: Creating a new NPC

pawn Code:
StartRecordingPlayback
This works only on the miniscript. In case you have it on Gamemode or FS and
pawn Code:
#include <a_npc>
it will give you errors.
__________________
Knowledge:
  • HTML
  • Pascal
  • Visual Basic
  • Algorithm
    • Pseudocode
Kostas' is offline   Reply With Quote
Old 21/11/2011, 05:42 PM   #1025
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default Re: Creating a new NPC

Quote:
Originally Posted by Kostas' View Post
pawn Code:
StartRecordingPlayback
This works only on the miniscript. In case you have it on Gamemode or FS and
pawn Code:
#include <a_npc>
it will give you errors.
whattt did you say?
You want to say that I can't use a_npc in gamemode or filterscript because something?
I want it in the include!
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 21/11/2011, 05:48 PM   #1026
Kostas'
High-roller
 
Kostas''s Avatar
 
Join Date: Sep 2011
Location: Athens, Greece
Posts: 1,063
Reputation: 101
Default Re: Creating a new NPC

I mean, that the a_npc.inc works only on the .pwn file that you add the name from the .rec file that you recorded. On this.
pawn Code:
#define RECORDING "mynpc" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.

#include <a_npc>
main(){}
public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);

#if RECORDING_TYPE == 1
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  public OnNPCExitVehicle() StopRecordingPlayback();
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
The NPC functions not working on Gamemode and Filterscript and it will give you errors for undefined symbol.
__________________
Knowledge:
  • HTML
  • Pascal
  • Visual Basic
  • Algorithm
    • Pseudocode
Kostas' is offline   Reply With Quote
Old 07/12/2011, 05:32 AM   #1027
GtaO_Magnifico
Big Clucker
 
GtaO_Magnifico's Avatar
 
Join Date: Oct 2011
Location: Latvia
Posts: 59
Reputation: 1
Default Re: Creating a new NPC

My NPC doesnt join it at all, my server is not passworded
GtaO_Magnifico is offline   Reply With Quote
Old 08/12/2011, 11:41 AM   #1028
Thresholdold
Huge Clucker
 
Thresholdold's Avatar
 
Join Date: Sep 2011
Location: Inside your RCON
Posts: 441
Reputation: 30
Default Re: Creating a new NPC

Code:
E:\ForBenny\SERVER\filterscripts\VIPG1.pwn(23) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd")
E:\ForBenny\SERVER\filterscripts\VIPG1.pwn(25) : error 017: undefined symbol "StartRecordingPlayback"
E:\ForBenny\SERVER\filterscripts\VIPG1.pwn(29) : warning 235: public function lacks forward declaration (symbol "OnNPCSpawn")
E:\ForBenny\SERVER\filterscripts\VIPG1.pwn(31) : error 017: undefined symbol "StartRecordingPlayback"
__________________
Thresholdold is offline   Reply With Quote
Old 08/12/2011, 05:15 PM   #1029
Thresholdold
Huge Clucker
 
Thresholdold's Avatar
 
Join Date: Sep 2011
Location: Inside your RCON
Posts: 441
Reputation: 30
Default Re: Creating a new NPC

I have fixed the errors... but now my NPC's won't even join the server, and it doesn't have a password on it, what's going on?
__________________
Thresholdold is offline   Reply With Quote
Old 18/12/2011, 05:18 PM   #1030
Hyldran
Little Clucker
 
Hyldran's Avatar
 
Join Date: Jul 2011
Location: Sweden
Posts: 15
Reputation: 0
Question Re: Creating a new NPC

Code:
C:\Users\Timmie\Desktop\SA-MP Server\gamemodes\grandlarc.pwn(499) : error 021: symbol already defined: "ConnectNPC"
C:\Users\Timmie\Desktop\SA-MP Server\gamemodes\grandlarc.pwn(501) : error 021: symbol already defined: "OnGameModeInit"
C:\Users\Timmie\Desktop\SA-MP Server\gamemodes\grandlarc.pwn(508) : error 021: symbol already defined: "OnGameModeInit"
C:\Users\Timmie\Desktop\SA-MP Server\gamemodes\grandlarc.pwn(515) : error 021: symbol already defined: "OnPlayerSpawn"
C:\Users\Timmie\Desktop\SA-MP Server\gamemodes\grandlarc.pwn(529) : warning 203: symbol is never used: "gArmySpawns"
C:\Users\Timmie\Desktop\SA-MP Server\gamemodes\grandlarc.pwn(529) : warning 203: symbol is never used: "gMedicalSpawns"
C:\Users\Timmie\Desktop\SA-MP Server\gamemodes\grandlarc.pwn(529) : warning 203: symbol is never used: "gPoliceSpawns"
C:\Users\Timmie\Desktop\SA-MP Server\gamemodes\grandlarc.pwn(529) : warning 203: symbol is never used: "lastanimid"
C:\Users\Timmie\Desktop\SA-MP Server\gamemodes\grandlarc.pwn(529) : warning 203: symbol is never used: "thisanimid"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
__________________

Hyldran 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
need help with NPC creating the_zande Help Archive 2 09/07/2010 11:44 PM
help creating a new gm Lookin Help Archive 8 16/06/2010 03:23 PM
I need a tut on creating kujox32 Help Archive 0 05/05/2010 02:16 AM
Creating Box VirSpectorX Help Archive 5 15/04/2010 02:47 PM
Help creating my own... x.X.LEGENDARIO.X.x Everything and Nothing 20 06/02/2010 03:40 PM


All times are GMT. The time now is 09:34 AM.


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