SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 09/07/2010, 07:16 PM   #1
the_zande
Big Clucker
 
the_zande's Avatar
 
Join Date: Apr 2010
Location: Oulu, Finland
Posts: 93
Reputation: 0
Default need help with NPC creating

so I have problem with creating NPC it is this: NPC connect then it will stay in spawn point and doesn't spawn in vehicle what I created ;o

I have that patch....
#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


..in NPCModes
and in filterscripts this one:

#include <a_samp>
#include <a_npc>

new MyFirstNPCVehicle; //Global variable!
public OnFilterScriptInit()
{
ConnectNPC("MyFirstNPC","mynpc");
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
MyFirstNPCVehicle = AddStaticVehicle(520,-2038.8418,145.7136,33.9382, 0, 0, 0);
return 1;
}

public OnFilterScriptExit()
{
return 1;
}



main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}



public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}

someone help me plz : (
the_zande is offline  
Old 09/07/2010, 11:31 PM   #2
the_zande
Big Clucker
 
the_zande's Avatar
 
Join Date: Apr 2010
Location: Oulu, Finland
Posts: 93
Reputation: 0
Default Re: need help with NPC creating

anyone please help me
the_zande is offline  
Old 09/07/2010, 11:44 PM   #3
selten98
Big Clucker
 
Join Date: May 2010
Location: Netherlands
Posts: 192
Reputation: 2
Default Re: need help with NPC creating

Quote:
#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


..in NPCModes
and in filterscripts this one:

#include <a_samp>
#include <a_npc>

new MyFirstNPCVehicle; //Global variable!
public OnFilterScriptInit()
{
ConnectNPC("MyFirstNPC","mynpc");
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
MyFirstNPCVehicle = AddStaticVehicle(520,-2038.8418,145.7136,33.9382, 0, 0, 0);
return 1;
}

public OnFilterScriptExit()
{
return 1;
}



main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}



public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
{
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}
the coordinates of the car dont matter
did you record it urself?
else try this
Quote:
#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


..in NPCModes
and in filterscripts this one:

#include <a_samp>
#include <a_npc>

new MyFirstNPCVehicle; //Global variable!
public OnFilterScriptInit()
{
ConnectNPC("MyFirstNPC","mynpc");
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
MyFirstNPCVehicle = AddStaticVehicle(520,-2038.8418,145.7136,33.9382, 0, 0, 0);
return 1;
}

public OnFilterScriptExit()
{
return 1;
}



main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}



public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnPlayerSpawn(playerid)
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "MyFirstNPC", true))
{
SetSpawnInfo( playerid, team, skin, x, y, z, angle, weap1, ammo1, weap2, ammo2, weap3, ammo3 );
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0);
return 1;
}
return 1;
}
//Other stuff for normal players goes here!
return 1;
}
selten98 is offline  
 

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
[Tutorial] Creating a new NPC kc Tutorials 1120 30/04/2019 02:00 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 03:04 AM.


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