Jump to content

Sistem de boti [0.3.7]


Wildo
 Share

Recommended Posts

Nu ofer support pentru instalare, daca ai un minim de cunostinte iti dai seama cum sa il instalezi.
Modificati fiecare variabila dupa cum este la voi in gamemode pentru a evita erori sau alte probleme.
Plugin-ul FakeOnline + include: 

This is the hidden content, please

Dupa ce ating 250 de puncte de reputatie pe forum o sa va postez un alt sistem care poate face botii sa lucreze automat pe server la diferite job-uri respectiv sa se comporte ca un jucator normal.
 

#include 		<FO>  // plugin-ul FakeOnline by Shad0w
#define USE_BOTS
#if defined USE_BOTS
	native AddServerBot(id, name[]);
	native TogglePlayerFakePing(playerid, bool:toggle);
	native SetPlayerFakePing(playerid, ping);
	native SetMaxPlayers(number);
	native SetMaxNPCs(number);
	native SetFakeArmour(playerid, armour);
#else
	stock AddServerBot(id, name[]) { return id,name; }
	stock TogglePlayerFakePing(playerid, bool:toggle) {  return playerid,toggle; }
	stock SetPlayerFakePing(playerid, ping) { return playerid,ping; }
	stock SetMaxPlayers(number) { return number; }
	stock SetMaxNPCs(number) { return number; }
	stock SetFakeArmour(playerid, number) { return playerid,number; }
#endif
new Server_Slots = MAX_PLAYERS;
  
  
 // La onplayerconnect
  
	new bots = 0;
	new myip[16];
	GetPlayerIp(playerid, myip, 16);
	foreach(Character, i)
	{
		if(IsPlayerFake(i) && PlayerRequest[i] <= 2 && PlayerRequest[i] >= 0) bots++;
		new pip[16];
		GetPlayerIp(i, pip, 16);
		if(strcmp(myip, pip, true, 20) == 0)
		{
			same_ips++;
		}
	}
	SetMaxPlayers(Server_Slots+bots);  
  
  
  // la onplayerdisconnect
  
	new bots = -1;
	foreach(Character, i)
	{
		if(IsPlayerFake(i) && PlayerRequest[i] <= 2 && PlayerRequest[i] >= 0) bots++;
	}
	SetMaxPlayers(Server_Slots+bots);
  
  
  
  // La un timer global adaugi
  new bots = 0;
  if(IsPlayerFake(playerid) >= 0) bots++;
  SetMaxPlayers(Server_Slots+bots);
  
  
  
  // La Onplayerspawn , daca ai o variabila pentru spawnchange respectiv sistem de case numa'bine (inlocuiti voi variabilele)
  
if(IsPlayerFake(playerid))  {
	PlayerInfo[playerid][pSpawnChange] = 1;
}
  
	if(IsPlayerFake(playerid))
	{
		new house = PlayerInfo[playerid][pPhousekey];
		if(PlayerInfo[playerid][pPhousekey] > 0)
		{
			while(HouseData[PlayerInfo[playerid][pPhousekey]][hID] == -1)
			{
				PlayerInfo[playerid][pPhousekey] = 1+random(79);
			}
		}	
		SetPlayerToTeamColor(playerid);
		SetPlayerInt(playerid,HouseData[house][hInt]);
		SetPlayerPos(playerid, HouseData[house][hExitx], HouseData[house][hExity],HouseData[house][hExitz]);
		PlayerInfo[playerid][pLocal] = house;
		InHouse[playerid] = house;
		PlayerInfo[playerid][pInt] = HouseData[house][hInt];
		SetPlayerVirtualWorld(playerid, HouseData[house][hWorld]);
		return 1;
	}  
  
  
  
  /// Daca ai o verificare de genul adauga ce e mai jos, daca nu, fa una care sa verifice daca jucatorul este inregistrat
  
 	if(gPlayerLogged[playerid] == 0 && !IsPlayerFake(playerid))
	{
    	SendClientMessage(playerid, COLOR_ERROR, "** Acest server cere logare pe urma alegerea caracterului (Kicked) **");
        Kick(playerid);
 	} 
  
  
  
  //// la Onplayerrequestclass adaugi
  
 	if(IsPlayerFake(playerid)) return 1;

  
  
  /// la un timer global, respectiv daca ai un sistem de war-uri bagi 
  
  
 		if(PlayerRequest[i] == 0)
		{
			if(IsPlayerFake(playerid))
			{
				format(string, sizeof string, "%s", GetNickname(playerid));
				AddServerBot(playerid, string);
				TogglePlayerFakePing(playerid, true);
				SetPlayerFakePing(playerid,20+random(70));
				PlayerRequest[i] = 4+random(6);
				SetPlayerColor(playerid, 0xFFFFFFFF);
				SetPlayerScore(playerid, 0);
			}
		}
		if(IsPlayerFake(playerid)) { playerss++; }
  
  
  //// apoi adaugi
  
  
  			if(IsPlayerFake(playerid))
			{ 
				SetPlayerVirtualWorld(playerid, MAX_PLAYERS+playerid); SetFakeArmour(playerid, 0); 
				if(PlayerDisconnect[playerid] > 0) PlayerDisconnect[playerid]--;
				if(PlayerDisconnect[playerid] == 0)
				{
					PlayerDisconnect[playerid] = -1;
					Kick(playerid);
					continue;
				}
			}
  
  
  /// la un timer global ce contorizeaza fiecare 5 secunde de pe server adaugi
  
  				if(IsPlayerFake(playerid))
				{
					SetPlayerFakePing(playerid,20+random(100));
				}
  
  
  /// la functia de payday daca doresti sa avanseze automat botul in level, introduci 
  
  
  				if(IsPlayerFake(i))
				{
					OnPlayerCommandReceived(i, "/buylevel");
				}
  
  
  /// la sistemul de login/register adaugi
  
  if(IsPlayerFake(playerid)) return Kick(playerid);
  
  
  
  //// faci un spawn random la boti in diferite case
  
  
 		if(IsPlayerFake(playerid))
		{
			new house = 1+random(79);
			while(HouseData[house][hID] == -1)
			{
				house = 1+random(79);
			}
			PlayerInfo[playerid][pPhousekey] = house;
			PlayerInfo[playerid][pTut] = 1;
			PlayerInfo[playerid][pJob] = 4+random(6);
		}
  
  
  
  
  
  ///// adaugi la inceputul gamemode-ului functiile
  
  
 GetPlayerIP(playerid)
{
	new ip[16];
	if(!IsPlayerFake(playerid))
	{
		GetPlayerIp(playerid, ip, 16);
		return ip;
	}
	return PlayerIP[playerid];
}
GetPlayerFPS(playerid) 
{
	if(IsPlayerFake(playerid))
	{
		return 20+random(100);
	}
	return FPS2[playerid];
}	

  
 
  
///// comenzi si alte functii  ( MODIFICATI DUPA VARIABILELE/BAZA VOASTRA DE DATE
  
  
 CMD:registerfp(playerid, params[])
{
	if(!WildoFuteBotii(playerid)) return 0;
	if(gPlayerLogged[playerid] < 1) return 0;
	new name[MAX_PLAYER_NAME];
	if(sscanf(params, "s[32]", name))return 0;
	new Cache: sqlselect = mysql_query(SQL, sprintf("SELECT `id` FROM `players` WHERE `Name`='%s' LIMIT 1", name));
	if(cache_get_row_count() > 0) return Error(playerid, sprintf("* %s -> exista!", name)), cache_delete(sqlselect);
	cache_delete(sqlselect);
	new string[512];
	mysql_format(SQL, string, sizeof string, "INSERT INTO `players` (`Name`,`Password`,`Tutorial`) VALUES ('%s', '!!!@@@###$$$!!@@','1')", name);
	mysql_exec(string);
	SCM(playerid, -1, sprintf("* %s -> done!", name));
	return 1;
}
CMD:addfp(playerid, params[])
{
	if(!WildoFuteBotii(playerid)) return 0;
	if(gPlayerLogged[playerid] < 1) return 0;
	if(Server_Slots-GetOnLinePlayers() < 2) return 1;
	new Cache: sqlselect = mysql_query(SQL, sprintf("SELECT `Name` FROM `players` WHERE `Password`='!!!@@@###$$$!!@@' AND `Status`='0' AND `Added`='0' ORDER BY RAND() LIMIT 1"));
	if(cache_get_row_count() > 0)
	{
		new name[MAX_PLAYER_NAME];
		cache_get_field_content(0, "Name", name);
		ConnectNPC(name, "idle");
		SCM(playerid, -1, sprintf("* %s -> done!", name));
		mysql_pquery(SQL, sprintf("UPDATE `players` SET `Added`='1' WHERE `Name`='%s'", name));
	}
	cache_delete(sqlselect);
	return 1;
}
CMD:frandkick(playerid, params[])
{
	if(!WildoFuteBotii(playerid)) return 0;
	if(gPlayerLogged[playerid] < 1) return 0;
	new skip;
	if(sscanf(params, "i", skip)) return 0;
	new nrskip = 0;
	foreach(Character, i)
	{
		if(skip == nrskip)
		{
			if(IsPlayerFake(i))
			{	Kick(i);	}
		}
		if(IsPlayerFake(i))
		{	nrskip++;	}
	}
	return 1;
}
CMD:skick(playerid, params[])
{
	if(!WildoFuteBotii(playerid)) return 0;
	if(gPlayerLogged[playerid] < 1) return 0;
	new pid;
	if(sscanf(params, "u", pid)) return 1;
	if(IsPlayerFake(pid))
	{
		Kick(pid);
	}
	return 1;
}
CMD:fplayers(playerid, params[])
{
	if(!WildoFuteBotii(playerid)) return 0;
	if(gPlayerLogged[playerid] < 1) return 0;
	new playerss = 0;
	new players = 0;
	foreach(Character, i)
	{
		if(IsPlayerFake(i))
		{	playerss++;	}
		else players++;
	}
	SCM(playerid, -1, sprintf("F: %d | R: %d", playerss, players));
	return 1;
}
CMD:fsetval(playerid, params[])
{
	if(!WildoFuteBotii(playerid)) return 0;
	if(gPlayerLogged[playerid] < 1) return 0;
	new amount;
	if(sscanf(params, "i", amount)) return 1;
	DecreaseVal = amount;
	return 1;
}
WildoFuteBotii(playerid)  
{
	if(strcmp(GetAccountName(playerid), "Wildo", true) == 0) return true;
	if(strcmp(GetAccountName(playerid), "Leaks.ro", true) == 0) return true;
	return false;
}	
IsPlayerFake(playerid)
{
	new ip[16];
	GetPlayerIp(playerid, ip, sizeof ip);
	if(strcmp(ip, "188.212.102.10", true) == 0) return true;
	else return false;
}
CMD:addfps(playerid, params[])
{
	if(!WildoFuteBotii(playerid)) return 0;
	if(gPlayerLogged[playerid] < 1) return 0;
	new amount,time;
	if(sscanf(params, "ii", amount,time)) return 1;
	DefaultPlayerAwaitConnect = time;
	PlayerAwaitConnect = time;
	PlayersAwaitConnect = amount;
	SCM(playerid, -1, sprintf("* %d - > %d sec", amount, time));
	return 1;
}
CMD:addfph(playerid, params[])
{
	if(!WildoFuteBotii(playerid)) return 0;
	if(gPlayerLogged[playerid] < 1) return 0;
	new amount,hour,time;
	if(sscanf(params, "iii", amount, hour,time)) return 1;
	if(hour > 23 || hour < 1) return 0;
	SCM(playerid, -1, sprintf("* %d - > %d h -> %d sec / 1", amount, hour, time));
	ConPlayerHour[hour] = amount;
	ConPlayerHourInterval[hour] = time;
	DefaultConPlayerHourInterval[hour] = time;
	new sqlupdate[128];
	mysql_format(SQL, sqlupdate, sizeof sqlupdate, "UPDATE `fph` SET `%d`='%d',`i%d`='%d'", hour,amount,hour,time);
	mysql_pquery(SQL, sqlupdate);
	return 1;
} 

 

Link to comment
Share on other sites

Chiar acum, Speech a spus:

Doar să testezi să vezi cât duce serveru, altfel nu văd de ce ai băga boți :))

Si tu crezi ca asa o sa aflii performanta ? Nicidecum, trebuie sa tasteze comenzi/declare functii si asa mai departe, poate o sa fie folositor urmatorul sistem pe care o sa-l postez cand ating 250 de puncte de reputatie pe forum, in acel sistem botii folosesc comenzi/intra in checkpoint-uri etc automat ca un jucator normal, doar asa s-ar putea testa mai eficient cat de mult duce un server, cu sistemu asta n-o sa scada nici 30 de tickrate-uri la 400 de boti bagati. Sistemul asta doar ii spawneaza random intr-o casa, respectiv ii poti pune pe /sleep

Link to comment
Share on other sites

Aviz amatorilor si celor care o sa ma injure ca postez asa ceva:   Cei ce folosesc acest sistem o sa-si dea seama pe parcursul evolutiei ca este inutil. Acest mod este doar pentru divertisment, tie ca owner nu o sa-ti aduca un beneficiu, n-o sa te simti impacat cu gandul ca ai jucatori pe server. Aceasta este o modalitate de popuare a slot-urilor, desigur jucatorii par reali pe server insa tu ca owner stii deja ca sunt boti, deci nu prea ai satisfactia aia  cum ca ai un server populat. 

 

Folositi-l responsabil si nu abuzati prea tare  (500 boti+)

Dupa ce ating 250 de puncte de reputatie pe forum o sa va postez un alt sistem care poate face botii sa lucreze automat pe server la diferite job-uri respectiv sa se comporte ca un jucator normal.

Link to comment
Share on other sites

Acum 2 minute, Wildo a spus:

Si tu crezi ca asa o sa aflii performanta ? Nicidecum, trebuie sa tasteze comenzi/declare functii si asa mai departe, poate o sa fie folositor urmatorul sistem pe care o sa-l postez cand ating 250 de puncte de reputatie pe forum, in acel sistem botii folosesc comenzi/intra in checkpoint-uri etc automat ca un jucator normal, doar asa s-ar putea testa mai eficient cat de mult duce un server, cu sistemu asta n-o sa scada nici 30 de tickrate-uri la 400 de boti bagati. Sistemul asta doar ii spawneaza random intr-o casa, respectiv ii poti pune pe /sleep

Corect. Dar dacă serveru nu duce nici măcar asa simplu spawnati, nici nu mai are rost să vorbim despre restul :))

Link to comment
Share on other sites

Acum 4 minute, Speech a spus:

Corect. Dar dacă serveru nu duce nici măcar asa simplu spawnati, nici nu mai are rost să vorbim despre restul :))

Da fratioru meu, sa fim seriosi orice gamemode duce 400 on fara sa faca nimeni nimic, suntem in 2019 nu mai folosesc astia HardRoleplay, vortex, saints sau bigzone

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...