Problem with NPCs/BOTs
#1

Hey,
I've scripted the bots. Th problem now is that those bots ON FOOT are leaving the server as soon as they join, and the ON VEHICLE bots are fine.

Reason shown: Connection Reset

Please help.
Reply
#2

give us your OnPlayerConnect code
Reply
#3

Код:
public OnPlayerConnect(playerid)
{

    new plrIP[16]; // The varyable
    GetPlayerIp(playerid, plrIP, sizeof(plrIP)); // I am getting their IP and storing it.

	new stringg[156];
 	new namee[30];
    GetPlayerName(playerid,namee,30);
	format(stringg,sizeof(stringg),"~g~Connect: ~y~%s~b~ [%d]",namee,playerid);
    AddConnection(stringg);
    
    PlayerIP[playerid] = plrIP;
	
	if(!IsPlayerNPC(playerid))
	{
	    new name[30];
	    GetPlayerName(playerid,name,30);
	    if(!strcmp(name,"[BOT]Tension",true) || !strcmp(name,"[BOT]Major",true) || !strcmp(name,"Vacant_House",true) || !strcmp(name,"Vacant_Business",true) || !strcmp(name,"[BOT]Osama",true) || !strcmp(name,"[BOT]Charlie",true) || !strcmp(name,"[BOT]Buzz",true) || !strcmp(name,"[BOT]Del_Trotter",true))
	    {
	        SendClientMessage(playerid,COLOR_RED,"This name is reserved! Change your name!");
			Kick(playerid);
		}
	}
	else
	if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)