Sa-mp 0.3 Creating NPC problems - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Sa-mp 0.3 Creating NPC problems (
/showthread.php?tid=141733)
Sa-mp 0.3 Creating NPC problems -
Tockra - 15.04.2010
Hey Guys,
i created this threat in a german (my tonguelanguage) forum before, but nobody could give me a good answere.
Here is my "oldtimer.amx" in D:\backup\Samp Gamemode V1.6.3\NEU\npcmodes :
Код:
#include <a_npc>
// name der recordeten datei (im beispiel war es CARBOT oder ZIVIBOT)
#define RECORDING "oldtimer"
// Record typ, 1 = in einen fahrzeug, 2 = zu fuЯ
#define RECORDING_TYPE 1
main()
{
}
public OnRecordingPlaybackEnd()
StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCEnterVehicle(vehicleid, seatid)
StartRecordingPlayback(RECORDING_TYPE, RECORDING);
public OnNPCExitVehicle()
StopRecordingPlayback();
My record date is named "oldtimer.rec" and is in D:\backup\Samp Gamemode V1.6.3\NEU\npcmodes\recordings .
Here is my clear script to test the bots
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <a_npc>
new CARBOTCAR;
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
ConnectNPC("oldtimer","oldtimer");
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
CARBOTCAR = CreateVehicle(545,1211.3824,-1321.7742,13.2849,355.9676,1,3,-1); // car 1
AddStaticVehicle(545,1190.5978,-1328.4066,13.3064,268.6359,1,3);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid) {
if(IsPlayerNPC(playerid))
{
new botname[MAX_PLAYER_NAME];
GetPlayerName(playerid, botname, sizeof(botname));
if(!strcmp(botname, "oldtimer", true))
{
PutPlayerInVehicle(playerid,CARBOTCAR, 0);
}
}
Now i my problem, that the bot connected, but then is he disappeard. When i entered the server and go to the recorded position (there spawn the bot car too), then is there nothing, the bot car is disapeard and the bot is not there. I hope you can help me, because i hate this bug.