26.09.2016, 12:27
Hello,
I'm using this zombie NPC filterscript:
https://sampforum.blast.hk/showthread.php?tid=115383
I'm having an issue with NPC's.
When they join my server, it says "A zombie connected" twice.. Only one zombie NPC spawns... After (or before) I kill that NPC, when I type /zombie, nothing happens. The "A zombie connected" message won't even show. I don't know what's going on. I've also allowed NPC's to pass through my login/register system. The problem is, why does the text show twice, and only spawn 1 zombie? And why am I able to only execute the command once and after that nothing happens? The only way I can fix it is by reloading the filterscript. But still then, only 1 zombie spawns and I get the message "A zombie connected" twice. Then once again, I'm not able to execute the command again because nothing happens. Here is my server log.
Here is OnPlayerConnect (Won't post the whole code, because it's very long.. But will post everything related to NPC's)
Here is the whole OnPlayerRequestClass
OnPlayerSpawn (full code)
Any help would be greatly appreciated...
If anyone would like to fix this for me completely over TeamViewer, I'd be happy to pay $5 to PayPal. Add me on Skype: joshmain1996
Thank you
I'm using this zombie NPC filterscript:
https://sampforum.blast.hk/showthread.php?tid=115383
I'm having an issue with NPC's.
When they join my server, it says "A zombie connected" twice.. Only one zombie NPC spawns... After (or before) I kill that NPC, when I type /zombie, nothing happens. The "A zombie connected" message won't even show. I don't know what's going on. I've also allowed NPC's to pass through my login/register system. The problem is, why does the text show twice, and only spawn 1 zombie? And why am I able to only execute the command once and after that nothing happens? The only way I can fix it is by reloading the filterscript. But still then, only 1 zombie spawns and I get the message "A zombie connected" twice. Then once again, I'm not able to execute the command again because nothing happens. Here is my server log.
Код:
[22:03:39] RCON (In-Game): Player #2 (Baker) has logged in. [22:03:43] RCON (In-Game): Player [Baker] sent command: loadfs zombie [22:03:43] ===================================== [22:03:43] Zombie Filterscript By Wafffllesss [22:03:43] ===================================== [22:03:43] Filterscript 'zombie.amx' loaded. [22:03:47] [connection] 127.0.0.1:56000 requests connection cookie. [22:03:48] [connection] incoming connection: 127.0.0.1:56000 id: 3 [22:03:48] [npc:join] Zombie_0 has joined the server (3:127.0.0.1) [22:04:08] [cmd] [Baker] /sorry baker [22:04:10] [cmd] [Baker] /goto ml [22:04:14] [cmd] [Baker] /givegun baker 24 [22:04:20] [cmd] [Baker] /givegun baker 27 [22:04:32] //Deleting Vehicles For ID: 3 [22:04:32] [npc:part] Zombie_0 has left the server (3:2) [22:04:34] [cmd] [Baker] /givegun baker 27 [22:04:36] [cmd] [Baker] /goto ml [22:04:40] [connection] 127.0.0.1:56003 requests connection cookie. [22:04:41] [connection] incoming connection: 127.0.0.1:56003 id: 3 [22:04:50] [connection] 127.0.0.1:56004 requests connection cookie. [22:04:51] [connection] incoming connection: 127.0.0.1:56004 id: 3 [22:05:04] [cmd] [Baker] /givegun baker 31 [22:05:13] [cmd] [Baker] /aduty [22:05:19] RCON (In-Game): Player [Baker] sent command: unloadfs zombie [22:05:19] Filterscript 'zombie.amx' unloaded. [22:05:21] RCON (In-Game): Player [Baker] sent command: loadfs zombie [22:05:21] ===================================== [22:05:21] Zombie Filterscript By Wafffllesss [22:05:21] ===================================== [22:05:21] Filterscript 'zombie.amx' loaded. [22:05:25] [connection] 127.0.0.1:56006 requests connection cookie. [22:05:26] [connection] incoming connection: 127.0.0.1:56006 id: 3 [22:05:26] [npc:join] Zombie_3 has joined the server (3:127.0.0.1) [22:05:32] //Deleting Vehicles For ID: 3 [22:05:32] [npc:part] Zombie_3 has left the server (3:2) [22:05:36] RCON (In-Game): Player [Baker] sent command: loadfs zombie [22:05:36] Filterscript 'zombie.amx' load failed. [22:05:37] RCON (In-Game): Player [Baker] sent command: loadfs zombie [22:05:37] Filterscript 'zombie.amx' load failed. [22:05:40] [connection] 127.0.0.1:56007 requests connection cookie. [22:05:41] [connection] incoming connection: 127.0.0.1:56007 id: 3 [22:05:51] RCON (In-Game): Player [Baker] sent command: unloadfs zombie [22:05:51] Filterscript 'zombie.amx' unloaded. [22:05:55] RCON (In-Game): Player [Baker] sent command: loadfs zombie [22:05:55] ===================================== [22:05:55] Zombie Filterscript By Wafffllesss [22:05:55] ===================================== [22:05:55] Filterscript 'zombie.amx' loaded. [22:05:57] [connection] 127.0.0.1:59619 requests connection cookie. [22:05:58] [connection] incoming connection: 127.0.0.1:59619 id: 3 [22:05:59] [npc:join] Zombie_5 has joined the server (3:127.0.0.1) [22:06:09] //Deleting Vehicles For ID: 3 [22:06:09] [npc:part] Zombie_5 has left the server (3:2) [22:06:14] [connection] 127.0.0.1:63315 requests connection cookie. [22:06:15] [connection] incoming connection: 127.0.0.1:63315 id: 3 [22:06:19] RCON (In-Game): Player [Baker] sent command: unloadfs zombie [22:06:19] Filterscript 'zombie.amx' unloaded. [22:06:22] RCON (In-Game): Player [Baker] sent command: loadfs zombie [22:06:22] ===================================== [22:06:22] Zombie Filterscript By Wafffllesss [22:06:22] ===================================== [22:06:22] Filterscript 'zombie.amx' loaded. [22:06:26] [connection] 127.0.0.1:63317 requests connection cookie. [22:06:27] [connection] incoming connection: 127.0.0.1:63317 id: 3 [22:06:27] [npc:join] Zombie_7 has joined the server (3:127.0.0.1) [22:06:35] //Deleting Vehicles For ID: 3 [22:06:35] [npc:part] Zombie_7 has left the server (3:2) [22:06:40] [connection] 127.0.0.1:63318 requests connection cookie. [22:06:41] [connection] incoming connection: 127.0.0.1:63318 id: 3 [22:06:42] RCON (In-Game): Player [Baker] sent command: unloadfs zombie [22:06:42] Filterscript 'zombie.amx' unloaded. [22:06:44] RCON (In-Game): Player [Baker] sent command: loadfs zombie [22:06:44] ===================================== [22:06:44] Zombie Filterscript By Wafffllesss [22:06:44] ===================================== [22:06:44] Filterscript 'zombie.amx' loaded. [22:06:47] [cmd] [Baker] /givegun baker 34 [22:06:58] [connection] 127.0.0.1:63319 requests connection cookie. [22:06:59] [connection] incoming connection: 127.0.0.1:63319 id: 3 [22:06:59] [npc:join] Zombie_9 has joined the server (3:127.0.0.1) [22:07:05] //Deleting Vehicles For ID: 3 [22:07:05] [npc:part] Zombie_9 has left the server (3:2)
PHP код:
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid))
{
gPlayerLoggin{playerid} = 1;
return 1;
}
//etc etc
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid))
{
SetSpawnInfo(playerid,0,162,857.71, -1369.36, 13.545,0,0,0,0,0,0,0);
SpawnPlayer(playerid);
return 1;
}
//needs to be fixed and added AFTER login, and needs to be fixed so it returns the script after it
/*new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
if(PlayerInfo[playerid][pAdmin] == 0 && strfind(name,"_",false)== -1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}This is a roleplay server. Please reconnect using a Firstname_Lastname format (E.G John_Smith).");
format(string, sizeof(string), "%s was kicked: Non-RP name", name);
SendClientMessageToAll(0xC4C4C4FF, string);
SetTimerEx("KickTimer",1000,false,"i", playerid);
return 1;
}*/
/*if(IsPlayerNPC(playerid))
{
printf("NPC: OnPlayerRequestClass: %d", playerid);
SetPlayerPos(playerid, 1.71875, 30.4062, 1200.34);
SetPlayerInterior(playerid,0);
RegistrationStep[playerid] = 0;
gPlayerAccount[playerid] = 1;
gPlayerLogged[playerid] = 1;
TutTime[playerid] = 0;
CanTalk[playerid] = 1;
PlayerInfo[playerid][pSafeSpawn] = 1;
SpawnPlayer(playerid);
return 1;
}*/
if(gPlayerLogged[playerid] == 0)
{
if(IsPlayerNPC(playerid)) return 1;
{
switch(gPlayerAccount[playerid])
{
case 0: DisplayDialogForPlayer(playerid, 2); //register
case 1: DisplayDialogForPlayer(playerid, 1); //login
}
}
}
SetupPlayerForClassSelection(playerid);
if(IsPlayerNPC(playerid)) return 1;
{
if(gPlayerSpawned[playerid] == 1)
{
if(PlayerInfo[playerid][pMember] > 0 || PlayerInfo[playerid][pLeader] > 0 || PlayerInfo[playerid][pFMember] != 255)
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
}
else
{
PlayerInfo[playerid][pModel] = PedSkins[classid][0];
}
}
else
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
}
}
return 1;
}
PHP код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
if(strfind(n,ZOMBIE_NAME) != -1)
{
//So you know..here spawned a zombie
SetPlayerPos(playerid, 857.36, -1371.86, 13.55);
SetPlayerSkin(playerid, 162); //This is a nice zombie skin xD
}
return 1;
}
if(gPlayerLogged[playerid] == 0 && !IsPlayerNPC(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "** This server requires you to login BEFORE spawn (Kicked) **");
// printf("OnPlayerSpawn Kick: %d",playerid);
SetTimerEx("KickTimer",1000,false,"i", playerid);
KickPlayer[playerid] = 1;
return 1;
}
if(PlayerInfo[playerid][pClothes] != 0)
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pClothes]);
}
else
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
}
//if(IsPlayerNPC(playerid)) return 1;
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "BlueBusDriver", true))
{
SetPlayerColor(playerid, 0xFFFFFF00);
PutPlayerInVehicle(playerid, NPCBlueBus, 0);
SetPlayerSkin(playerid, 255);
ResetPlayerWeapons(playerid);
Attach3DTextLabelToVehicle(NPCTextBlue, NPCBlueBus, 0.0, 0.0, 0.0);
}
if(!strcmp(npcname, "BlackBusDriver", true))
{
SetPlayerColor(playerid, 0xFFFFFF00);
PutPlayerInVehicle(playerid, NPCBlackBus, 0);
SetPlayerSkin(playerid, 255);
ResetPlayerWeapons(playerid);
Attach3DTextLabelToVehicle(NPCTextBlack, NPCBlackBus, 0.0, 0.0, 0.0);
}
}
if(!gPlayerAnimLibsPreloaded[playerid])
{
PreloadAnimLib(playerid,"BOMBER");
PreloadAnimLib(playerid,"RAPPING");
PreloadAnimLib(playerid,"SHOP");
PreloadAnimLib(playerid,"BEACH");
PreloadAnimLib(playerid,"SMOKING");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"PED");
PreloadAnimLib(playerid,"GANGS");
gPlayerAnimLibsPreloaded[playerid] = 1;
}
Spawned[playerid] = 1;
SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,0);
SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,0);
SetPlayerWeapons(playerid);
SetPlayerSpawn(playerid);
PlayerFixRadio(playerid);
gPlayerSpawned[playerid] = 1;
TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);
/*for(new i=0; i < sizeof(TurfInfo); i++)
{
if(TurfInfo[i][tOwner] == 255)
{
GangZoneShowForPlayer(playerid, Turfs[i], COLOR_TWWHITE);
}
if(TurfInfo[i][tOwner] < 15)
{
GangZoneShowForPlayer(playerid, Turfs[i], GetFamilyColor(TurfInfo[i][tOwner]));
}
if(TurfAttacker[i] != -1)
{
GangZoneShowForPlayer(playerid, Turfs[i], COLOR_TWWHITE);
GangZoneFlashForPlayer(playerid, Turfs[i], COLOR_TWRED);
}
}*/
//SyncTurfRadar();
return 1;
}
If anyone would like to fix this for me completely over TeamViewer, I'd be happy to pay $5 to PayPal. Add me on Skype: joshmain1996
Thank you