// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("AdmBot NPC");
ConnectNPC("AdmBot","justnpc");
MyFirstNPCVehicle = CreateVehicle(437, 0.0, 0.0, 5.0, 0.0, 198, 166, 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, "AdmBot", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerSkin(playerid, 147);
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
}
}
public OnFilterScriptExit()
{
print("AdmBot NPC Unloaded");
return 1;
}
#else
main()
{
print("\n----------------------------------");
print("AdmBot NPC Unloaded");
print("----------------------------------\n");
}
#endif
C:\Documents and Settings\Youssef\Bureau\RPG Romania 1.00.40\filterscripts\AdmBot.pwn(13) : error 017: undefined symbol "MyFirstNPCVehicle" C:\Documents and Settings\Youssef\Bureau\RPG Romania 1.00.40\filterscripts\AdmBot.pwn(25) : error 017: undefined symbol "MyFirstNPCVehicle" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
new MyFirstNPCVehicle = INVALID_VEHICLE_ID;
Hello Youssefree,
you have to create this variable on top of your script: Код:
new MyFirstNPCVehicle = INVALID_VEHICLE_ID; |
Hello Youssefree,
you have to create this variable on top of your script: Код:
new MyFirstNPCVehicle = INVALID_VEHICLE_ID; |
if ( IsPlayerNPC ( playerid ) )
{
return 1;
}
Is the NPC disconnecting from your server? If so, you might need to bypass any login scripts you have
Use the following at the top of OnPlayerConnect, OnPlayerSpawn (after putting the NPC in a vehicle) and on OnPlayerRequestSpawn: pawn Код:
|
SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [01:25:57] [01:25:57] Server Plugins [01:25:57] -------------- [01:25:57] Loading plugin: mysql.so [01:25:58] >> plugin.mysql: R38 successfully loaded. [01:25:58] Loaded. [01:25:58] Loading plugin: sscanf.so [01:25:58] [01:25:58] =============================== [01:25:58] sscanf plugin loaded. [01:25:58] Version: 2.8.1 [01:25:58] © 2012 Alex "******" Cole [01:25:58] =============================== [01:25:58] Loaded. [01:25:58] Loading plugin: streamer.so [01:25:58] *** Streamer Plugin v2.7.9 by Incognito loaded *** [01:25:58] Loaded. [01:25:58] Loaded 3 plugins. [01:25:58] [01:25:58] Ban list [01:25:58] -------- [01:25:58] Loaded: samp.ban [01:25:58] [01:25:58] [01:25:58] Filterscripts [01:25:58] --------------- [01:25:58] Loading filterscript 'speedometer.amx'... [01:25:58] --- Speedometer by: LINKINPARK --- [01:25:58] Loading filterscript 'playall.amx'... [01:25:58] Unable to load filterscript 'playall.amx'. [01:25:58] Loading filterscript 'RAce.amx'... [01:25:58] Loading filterscript 'AdmBot.amx'... [01:25:58] AdmBot NPC [01:25:58] Loaded 3 filterscripts. [01:25:58] Turfs: 48 [01:25:58] 162 - Objects. [01:25:58] 17 - Pickups. [01:25:58] OnGameModeInit Loaded [01:25:58] Script loaded - s4uriK RPG Romania 1.00.40 [01:25:58] Number of vehicle models: 123 [01:25:58] Houses: 101 [01:25:58] Bussines: 54 [01:25:58] Dynamic Factions: 14 [01:25:58] Clans: 4 [01:25:58] Cars: 24 [01:25:58] Stocks: 101
Hello Youssefree,
your bot dont even connect to the server. Make sure your maxnpc inside the server.cfg is set to a minimum of 1. Also check if you do have the record files for your bot. If you didnt realy understand what am i talking about feel free to use the forum search function to get nice tutorials by similar persons. |
Hello!
I searched a tutorial for you so that you feel easier to do that. => https://sampforum.blast.hk/showthread.php?tid=95034 I hope this will help you. |