04.09.2009, 18:59
I tried to use AddStaticVehicle but nothing changes.
The problem may be due to my gamemode?
The problem may be due to my gamemode?
Originally Posted by SFather
can bots use animations?
I have recorded action of foot with using of animations, and the result is just walking, and no animations. Preloading animation libraries don't help too. Or I just trying for nothing? |
Originally Posted by kc
Quote:
|
#include <a_samp>
#include <a_npc>
public OnFilterScriptInit()
{
ConnectNPC("Guy","ShinderNPC");
return 1;
}
public OnRecordingPlaybackEnd() StartRecordingPlayback(2, ShinderNPC);
C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(10) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd") C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(10) : error 017: undefined symbol "StartRecordingPlayback"
Originally Posted by Bcklup
Hi, i made a NPC that walks around a little area here's the code:
Code:
#include <a_samp>
#include <a_npc>
public OnFilterScriptInit()
{
ConnectNPC("Guy","ShinderNPC");
return 1;
}
public OnRecordingPlaybackEnd() StartRecordingPlayback(2, ShinderNPC);
Code:
C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(10) : warning 235: public function lacks forward declaration (symbol "OnRecordingPlaybackEnd") C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(10) : error 017: undefined symbol "StartRecordingPlayback" Or does the NPC really needs to just drive a stupid car but can't walk? |
C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(3) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(5) : error 017: undefined symbol "ConnectNPC"
C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(9) : warning 235: public function lacks forward declaration (symbol "OnPlayerSpawn")
C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(11) : error 017: undefined symbol "IsPlayerNPC"
C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(11) : error 017: undefined symbol "SetPlayerSkin"
C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(14) : error 017: undefined symbol "ShinderNPC"
public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid) == 1) SetPlayerSkin(playerid, 29); }
C:\Documents and Settings\Administrator\Desktop\ETC\GTA SA Stuff\sampserver0.3\filterscripts\NPCs.pwn(6) : error 017: undefined symbol "ConnectNPC"
Originally Posted by ZeeX
As I understand, your script is a filterscript and not npcmode, right? If so, include a_samp instead of a_npc.
|
#include <a_samp>
new MyFirstNPCVehicle;
public OnFilterScriptInit()
{
print("my filterscript");
ConnectNPC("MyFirstNPC","hydrapilot");
MyFirstNPCVehicle = CreateVehicle(520, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
return 1;
}
public OnPlayerSpawn(playerid)
{
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;
}
Originally Posted by Cedimedi
pawn Code:
|
#include <a_samp>
new hydra;
public OnGameModeInit()
{
ConnectNPC("Driver","hydrapilotA");
hydra = AddStaticVehicle(520,2044.8854,1473.2106,10.4494,181.3339,6,1); // Taxi
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Driver", true))
{
PutPlayerInVehicle(playerid, hydra, 0);
}
}
return 1;
}
new NPCP; |
ConnectNPC("PoliceMan_","Police_PatrolNPC"); NPCP = CreateVehicle(596,1535.8658,-1668.4530,13.0795,358.5437,1,0, 5000); |
if(IsPlayerNPC(playerid)) { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name. if(!strcmp(npcname, "PoliceMan_", true)) //Checking if the NPC's name is MyFirstNPC { //SetPlayerSkin(playerid, 280); PutPlayerInVehicle(playerid, NPCP, 0); //Putting the NPC into the vehicle we created for it. //SetSpawnInfo( playerid, 0, 280, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 ); } return 1; } |
#define RECORDING "Police_Patrol" //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); public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING); public OnNPCExitVehicle() StopRecordingPlayback(); |
Originally Posted by _Ben_[Fux-c.co.il RP
]
I got problem.. Its creating vehicle, But nobody drive on it. I did all the things are needed in the folder npcmodes. |
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.
public OnFilterScriptInit() { print("my filterscript"); ConnectNPC("MyFirstNPC","BOT"); return 1; } new MyFirstNPCVehicle; //Global variable! public OnFilterScriptInit() { print("my filterscript"); ConnectNPC("MyFirstNPC","BOT"); MyFirstNPCVehicle = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); return 1; } public OnPlayerSpawn(playerid) { 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; }
C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit") C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(3) : error 017: undefined symbol "print" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(4) : error 017: undefined symbol "ConnectNPC" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(9) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit") C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(10) : error 021: symbol already defined: "OnFilterScriptInit" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(11) : error 017: undefined symbol "print" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(12) : error 017: undefined symbol "ConnectNPC" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(13) : error 017: undefined symbol "CreateVehicle" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(17) : warning 235: public function lacks forward declaration (symbol "OnPlayerSpawn") C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(19) : error 017: undefined symbol "IsPlayerNPC" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(21) : error 017: undefined symbol "MAX_PLAYER_NAME" C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(21) : error 009: invalid array size (negative, zero or out of bounds) C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(21) : error 036: empty statement C:\Program Files\gta.sa\GTA San Andreas\filterscripts\npc_test_2.pwn(21) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
#include <a_samp> // top of script
Originally Posted by matrix_smq
Having problems when adding a NPC, i added
Code:
if(IsPlayerNPC(playerid)) return 1; |