SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 18/09/2012, 06:02 PM   #1
Squirrel
Huge Clucker
 
Join Date: Feb 2012
Posts: 390
Reputation: 11
Default Problems with NPC (spawn problems)

I cant spawn NPC's. I dont know why.
Here is the code of how I added it:

PHP Code:
ConnectNPC("[BOT]GroveStreet","NPC"); //This is on game mode init

    
if(IsPlayerNPC(playerid)) //OnPlayerSpawn
    
{
        
SetPlayerSkin(playerid,12);
        
GivePlayerWeapon(playerid,24,99999);
        return 
1;
    } 
I have file named "NPC" in my npcmodes and I have a file called "twinkisnpc" in my recordings.


I do not get any errors but it's not spawning them :/

my npc mode
PHP Code:
#include <a_npc>



main() {}



NextPlayBack()
{
    
StartRecordingPlayback(PLAYER_RECORDING_TYPE_ONFOOT,"NPC");
}

public 
OnRecordingPlaybackEnd()
{
    
NextPlayBack();
}
public 
OnNPCSpawn()
{
    
NextPlayBack();
}
public 
OnNPCExitVehicle()
{
    
StopRecordingPlayback();


It's connecting the NPC but not actually spawning it...
PHP Code:
[20:24:43] [npc:join] [BOT]GroveStreet has joined the server (0:127.0.0.1
Squirrel is offline   Reply With Quote
Old 18/09/2012, 06:12 PM   #2
Hiddle
Little Clucker
 
Join Date: Jul 2011
Posts: 27
Reputation: 1
Default Re: Problems with NPC (spawn problems)

Well, you haven't set them up for spawning, For my NPC, in the npcmode it looks like this:


Code:
#define RECORDING "DealerNPC2" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 2 //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() 
  {
                
		 SetMyPos(1091.7188,-1791.7927,13.6404); <------  Maybe try Putting this in yours?
		 StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  }
#endif
Hiddle is offline   Reply With Quote
Old 18/09/2012, 06:14 PM   #3
Squirrel
Huge Clucker
 
Join Date: Feb 2012
Posts: 390
Reputation: 11
Default Re: Problems with NPC (spawn problems)

Is that in your npcmodes or in your GM?
Squirrel is offline   Reply With Quote
Old 18/09/2012, 06:16 PM   #4
Hiddle
Little Clucker
 
Join Date: Jul 2011
Posts: 27
Reputation: 1
Default Re: Problems with NPC (spawn problems)

Npcmodes
Hiddle is offline   Reply With Quote
Old 18/09/2012, 06:20 PM   #5
Squirrel
Huge Clucker
 
Join Date: Feb 2012
Posts: 390
Reputation: 11
Default Re: Problems with NPC (spawn problems)

Thanks mate. I finally did it. It's just spawning correctly Just to add few more things in it and I will be one happy panda.
+rep!
Squirrel 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
2 Problems Padarom Scripting Help 0 04/01/2012 10:59 AM
cmd problems mel~vin Help Archive 4 17/04/2010 04:59 PM
Problems with ID 13 [mad]MLK Help Archive 20 14/10/2009 10:06 AM
Problems with new PC Klutty Everything and Nothing 13 13/09/2009 12:47 PM
[FS]CarOwnership problems, GM Problems coole210 Help Archive 8 17/06/2009 09:27 PM


All times are GMT. The time now is 11:04 PM.


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