[HELP]bot 2 just stands there and does not drive in his vehicle
#1

#include <a_samp>
#include <a_npc>
#include <attacking_npc>

new Random;
new patriot;

public OnGameModeInit()
{
// NPCS
ConnectNPC("bot1","striper1");
ConnectNPC("bot2","striper2");
patriot = AddStaticVehicle(470,1248.8331,-806.1240,83.9407,179.9658,115,115); // bot car
return 1;
}

public OnPlayerSpawn(playerid)
{
if(!IsPlayerNPC(playerid)) return 0; // We only deal with NPC players in this script
new playername[64];
GetPlayerName(playerid,playername,64);

if(!strcmp(playername,"bot1",true)) {
SetPlayerSkin(playerid,165);
SetPlayerColor(playerid, 0xAA3333AA);
ShowPlayerMarkers(30);
}
else if(!strcmp(playername,"bot2",true)) {
PutPlayerInVehicle(playerid, patriot, 0);
SetPlayerSkin(playerid,165);
SetPlayerColor(playerid, 0xAA3333AA);
ShowPlayerMarkers(30);
}
return 1;
}
// SetPlayerSkin(playerid,165);
// SetPlayerColor(playerid, 0xAA3333AA);
need some help
Reply
#2

try
Код:
if(!strcmp(playername,"bot2",true)) {
instead
Код:
else if(!strcmp(playername,"bot2",true)) {
Reply
#3

Quote:
Originally Posted by actiwe
try
Код:
if(!strcmp(playername,"bot2",true)) {
instead
Код:
else if(!strcmp(playername,"bot2",true)) {
dident work
but thanks for trying =/
Reply
#4

hmmm... can you show us the 'npc script' ?
Reply
#5

Quote:
Originally Posted by boelie
hmmm... can you show us the 'npc script' ?
#define RECORDING "patpat" //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
//save this to npcmodes folder in your SA-MP server's folder, and compile it.
Reply
#6

Does skin changes and etc work ?
Reply
#7

Quote:
Originally Posted by actiwe
Does skin changes and etc work ?
Yeh
Reply
#8

did you put your recording in the correct folder ?
Reply
#9

Quote:
Originally Posted by boelie
did you put your recording in the correct folder ?
yeh
Reply
#10

mmhh weird :S it must be something under onplayerspawn then, cause my npc's are always staying out there vehicle if something happend to onplayerspawn in my gamemode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)