Hallou, hab ein Problem und zwar Connecten meine NPC´s nicht laut Log aber schon?
Hier erstmal die LOG:
[2013-04-08 03:45:54] * Connecting NPCs...
[2013-04-08 03:45:54] NPC LVAP_Guard was connected ID: 49 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:54] NPC SFTram was connected ID: 52 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC Train1 was connected ID: 53 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC ADAC_LV_Guard was connected ID: 54 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC TestMultiRec was connected ID: 55 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC LVBus1a was connected ID: 56 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC LVBus2a was connected ID: 57 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC LVBus1b was connected ID: 49 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC Train2 was connected ID: 49 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC LVBus2b was connected ID: 49 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC SFBus1a was connected ID: 49 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC SFBus1b was connected ID: 49 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] NPC DrivingSchoolOffice was connected ID: 49 on position 0.000000,0.000000,0.000000
[2013-04-08 03:45:55] 13 NPCs connected
[2013-04-08 03:45:55] * Loading vehicle models...
[2013-04-08 03:45:55] 212 vehicle models loaded
[2013-04-08 03:45:55] * Destroying vehicles...
[2013-04-08 03:45:55] * Loading saved vehicles...
[2013-04-08 03:45:56] 266 vehicles loaded
[2013-04-08 03:45:56] * Loading original vehicles...
[2013-04-08 03:45:56] 3 vehicles loaded
[2013-04-08 03:45:56] * Adding vehicle components...
[2013-04-08 03:45:56] 62 vehicle components added
[2013-04-08 03:45:56] * Put NPCs in vehicles...
[2013-04-08 03:45:56] NPC SFTram with the is in car 220
[2013-04-08 03:45:56] NPC Train1 with the is in car 221
[2013-04-08 03:45:56] NPC LVBus1a with the is in car 243
[2013-04-08 03:45:56] NPC LVBus2a with the is in car 244
[2013-04-08 03:45:56] NPC LVBus1b with the is in car 245
[2013-04-08 03:45:56] NPC Train2 with the is in car 246
[2013-04-08 03:45:56] NPC LVBus2b with the is in car 250
[2013-04-08 03:45:56] NPC SFBus1a with the is in car 251
[2013-04-08 03:45:56] NPC SFBus1b with the is in car 252
[2013-04-08 03:45:56] 9 NPCs put in vehicles
Alles anzeigen
Wie man sieht sie connecten und werden sofort ins auto geportet. So doch es ist kein einziger Bot Online?
Ich weis nicht ob ihr mir Helfen könnt da ich etwas anders Scripte, aber ich würde mich freuen, wenn ihr mir Helfen könnt.
Hier mal der Code:
// Config
#define MAX_NPC_MULTIRECS 10// Number of recordings asigned to a MultiRec NPC
#define NPC_SCRIPTNAME "recording"
// OnGameModeInit
ReconnectNPCs();
ReloadVehicleModels();
ReloadVehicles(true);
Keine Sorge da ist schon mehr Drin in OnGameModeInit ich habe jetzt nur das was mit NPC zu tun hat raus gesucht.
// ReconnectNPCs
ReconnectNPCs(playerID = INVALID_PLAYER_ID)
{
AdminPrint(playerID, COLOR_INFO, "* Kicking NPCs...");
PlayerLoop(npcPlayerID)
{
if (IsPlayerNPC(npcPlayerID))
{
Kick(npcPlayerID);
}
}
AdminPrint(playerID, COLOR_INFO, "* Connecting NPCs...");
new count;
mysql_query("SELECT * FROM `npcs` WHERE `autoConnect`");
mysql_store_result();
while (FetchMySQLRow())
{
ConnectNPC(GetMySQLField("name"), NPC_SCRIPTNAME);
count++;
}
mysql_free_result();
AdminPrint(playerID, COLOR_INFO, "* NPC %s was connected ID: %d on position %f,%f,%f", GetMySQLField("name"), GetMySQLField("id"), GetMySQLField("spawnPosX"), GetMySQLField("spawnPosY"), GetMySQLField("spawnPosZ"));
AdminPrint(playerID, COLOR_INFO, "* %d NPCs connected", count);
}
// OnPlayerConnect
if (IsPlayerNPC(playerid))
{
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
if (strcmp(ip, "127.0.0.1", true))
{
MySQLBan(INVALID_PLAYER_ID, playerid, "External NPC connection", true);
return false;
}
SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);// Always spawn NPCs in a not visible area (At position 0 x 0 x 0)
return true;
}
// OnGameModeExit
if (IsPlayerNPC(playerID))
{
Kick(playerID);
}
// OnPlayerDisconnect
if (IsPlayerNPC(playerid))
{
return true;
}
PlayerLoop(playerID)
{
if (!IsPlayerNPC(playerID) && playerID != playerid)
{
SendClientMessageEx(playerID, COLOR_JOINLEAVE, 161, playerid, reasonString);
}
}
// OnPlayerEnteredVehicle
if (IsPlayerNPC(playerID))
{
return true;
}
if (modelID == 420)
{
new npcPlayerID;
MySQLQuery("SELECT * FROM `npcs` WHERE `vehicleId` = '%d'", VehicleProperty:vehicleID[SAVEID]);
mysql_store_result();
if (mysql_num_rows())
{
npcPlayerID = GetPlayerID(GetMySQLField("name"));
}
mysql_free_result();
if (npcPlayerID != INVALID_PLAYER_ID)
{
if (isPassenger)
{
SendNPCCommand(npcPlayerID, "start");
return true;
}
else
{
return false;
}
}
}
// OnPlayerSpawn
if (IsPlayerNPC(playerid))// The player is a NPC
{
MySQLQuery("SELECT * FROM `npcs` WHERE `name` = '%s'", MySQLEscapeString(GetPlayerNameEx(playerid)));
mysql_store_result();
SetPlayerSkin(playerid, strval(GetMySQLField("skin")));
new vehicleID = GetVehicleBySaveID(strval(GetMySQLField("vehicleId")));
if (vehicleID)
{
PVar:playerid[NPC_RECORDINGTYPE] = PLAYER_RECORDING_TYPE_DRIVER;
PutPlayerInVehicle(playerid, vehicleID, 0);
SetVehicleEngineState(vehicleID, true);
}
else
{
PVar:playerid[NPC_RECORDINGTYPE] = PLAYER_RECORDING_TYPE_ONFOOT;
}
new tryMultiRecForID;
new startOnConnect = strval(GetMySQLField("startOnConnect"));
PVar:playerid[NPC_AUTOREPEAT] = strval(GetMySQLField("autoRepeat"));
if (floatstr(GetMySQLField("spawnPosX")) || floatstr(GetMySQLField("spawnPosY")) || floatstr(GetMySQLField("spawnPosZ")))
{
FormatNew:command[100]("teleport %s %s %s %s", GetMySQLField("spawnPosX"), GetMySQLField("spawnPosY"), GetMySQLField("spawnPosZ"), GetMySQLField("spawnAngle"));
SendNPCCommand(playerid, command);
tryMultiRecForID = 0;
}
if (strlen(GetMySQLField("recording")))
{
FormatNew:command[40]("setrec %s %d %d %d %d", GetMySQLField("recording"), PVar:playerid[NPC_RECORDINGTYPE], PVar:playerid[NPC_AUTOREPEAT], startOnConnect, strval(GetMySQLField("startDelay")));
SendNPCCommand(playerid, command);
}
else
{
tryMultiRecForID = strval(GetMySQLField("id"));
}
mysql_free_result();
if (tryMultiRecForID)
{
new slot;
MySQLQuery("SELECT * FROM `npcmultirecs` WHERE `npcId` = '%d'", tryMultiRecForID);
mysql_store_result();
while (FetchMySQLRow())
{
PVar:playerid[NPC_RECORDINGS][slot] = strval(GetMySQLField("id"));
slot++;
}
mysql_free_result();
if (slot)
{
if (startOnConnect)
{
PlayNextNPCRecording(playerid);
}
}
}
return true;
}
So ich hoffe ihr könnt mir Helfen. Ich verzweifle langsam echt daran Ich sitzt jetzt Glaube schon fast 4 Stunden an diesen Schmarn und komm einfach nicht darauf, was es sein könnte. Komischerweise, seit dem ich auf 0.3x Geupdatet hab funkionieren die NPC´s nimmer? Liegt es vielleicht daran? Bei 0.3e haben se noch Funkioniert.
Ist vielleicht eins meiner Script Weise falsch? Muss was geändert werden Bezüglich der NPC´s wegen dem Update auf 0.3x`?
Schon mal ein Danke im Vorraus.
Mit Freundlichen Grüssen
Tobi