SA-MP Forums Archive
npc:part has left the server - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: npc:part has left the server (/showthread.php?tid=285352)



npc:part has left the server - toshibarato - 23.09.2011

Hello all, i have created a filterscript for GF and want to get some NPC.

Not sure if it will be by the server version 0.3c R2, but the npc is expelled from the server.

public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
SetGameModeText("Blank Script" );
ConnectNPC("Manolo_Rodriguez","licenciero" );
BOTAUTO = AddStaticVehicleEx(405,1834.7405,-1871.3298,15.2829,0.0767,17,17,60000);
return 1;
}




public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) //Checkea si el jugador conectado es un npc
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "Manolo_Rodriguez", true)) //ESTE VA A HACER EL NOMBRE DE SU BOT
{
SpawnPlayer(playerid);
return 1;
}
}

return 0;
}


public OnPlayerSpawn(playerid)
{

if(IsPlayerNPC(playerid)) //Checkea si el jugador conectado es un npc
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "Manolo_Rodriguez", true)) //ESTE VA A HACER EL NOMBRE DE SU BOT
{
SetPlayerSkin(playerid, 116);//AQUI PONEN EL ID DE LA PIEL QUE QUIERE QUE TENGA
PutPlayerInVehicle(playerid, BOTAUTO,0);//ESTO ES PARA EL AUTO DEL BOT
SetPlayerColor(playerid,0x00F9F9FF);//ESTO ES EL COLOR DEL BOT
}
}


return 0;
}


A ver si alguien me puede echar una mano, que no encuentro anda por Internet, Un saludo.

їComo conectar un npc a un server 0.3c R2 sin que lo expulse el servidor?

gracias


Re: npc:part has left the server - CmZxC - 24.09.2011

Have you moved the .rec file from the scriptfiles/%filenamehere%.rec to this folder : npcmodes/recordings ( or something similar to it? )


Re: npc:part has left the server - Surferdude - 26.09.2011

I think the problem lies in your server.cfg. Make sure you have MAXNPCS to 1 or more. If the problem is still happening make sure you have the correct .rec folder and you have chosen the correct .rec folder in your PWN File.