Jump to content
  • 0

auto AFK sistem


Mititel

Question

Am cauta aici si pe sa-mp.com si pe Google da nu gasesc nimic de auto afk. Adica cand cineva sta nemiscat 5-10 minute sa ii se schimbe culoarea si sa nu poata da un playeri celui afk /w si cand revine sa sa faca culoarea la loc am dat cautare pe google cu auto afk sistem dar tot imi da cu /afk si /back eu nu vreau sa fie cu /afk sau /back sa se puna automat singur afk si sa nu ii poti da /w playerului care e AFK si cand revine sa ii poti da /w si sa revina culoarea

Ex: /w gigel salut si cand e afk sa scrie Acesta player este AFK si cand nu mai e afk sa ii poti da /w

default.png
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

[ocde]
//Ti-am fakut eu unu..
new AFK[MAX_PLAYERS];

OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp("/afk",cmdtext,true) ==0)
{
new nume[20];
AFK[playerid] =1;
TogglePlayercControllable(playerid,0);
GetPlayerName(playerid,nume,sizeof(nume));

new format33[33];
format(format33,sizeof(33),"%s is now afk",nume);
GameTextForAll(format33,3000,2);

}
if(strcmp("/back",cmdtext,true) ==0)
{
new name[45];
new format333[46];
AFK[playerid] =0;
TogglePlayerControllable(playerid,1);
GetPlayerName(playerid,name.sizeof(name)
format(format333,sizeof(format333,"%s has now back",name);
GameTextForAll(format333,3000,2);
return 1;
}
return 0;
}

public OnPlayerConnect()
{
AFK[playerid]=0;
}
public OnPlayerDisconnect()
{
AFK[playerid]=0;
}

eu ti lam fakut asa...in graba asta doar te pune pe afk si zice celor lalti ca esti afk nu schimba culoarea daka vrei caut pe net..normal ar fi trb sa se dea TP da... am vrut sa te ajut ;)

New GameMode In Development!-Romania Team Gang War-100%!...Datimi doua Motive afrimative de ce sa-l postez si-l postez...

Link to comment
Share on other sites

Nu vreau cu comenzi de genu /afk sau /back sa se puna direct afk cand nu se misca 5-10 minute si sa aiba o culoare gri inchis si sa nu ii poti da /w si sa ii poti da /w cand revine culoarea normala si cand cineva ii da /w sa zica ,,Acest player este afk"

default.png
Link to comment
Share on other sites

Nu vreau cu comenzi de genu /afk sau /back sa se puna direct afk cand nu se misca 5-10 minute si sa aiba o culoare gri inchis si sa nu ii poti da /w si sa ii poti da /w cand revine culoarea normala si cand cineva ii da /w sa zica ,,Acest player este afk"

Raspunde cineva?

default.png
Link to comment
Share on other sites

pui astea la new

new AFK[MAX_PLAYERS];
Pui sub public OnPlayerConnect(playerid) asta
AFK[playerid] = 0;
Asta o pui la IF;
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		admins --;
		if(AFK[playerid] == 1)
		{
		    afkadmins --;
		}
	}
Asta la else:
				else if(listitem == 5)
				{
				    if(PlayerInfo[playerid][pAdmin] < 6)
					{
						SendClientMessage(playerid, COLOR_GREY, "* You are not authorized to use this option");
						return 1;
					}
				    if(AntiAfk == 1)
				    {
				        SendClientMessage(playerid, COLOR_GREY, "* You have Turned off the Anti AFK detection!");
				        AntiAfk = 0;
				        format(string, sizeof(string), "[ADMIN]: %s has turned off the Anti AFK detection.",sendername);
				        ABroadCast(COLOR_LIGHTRED, string, 5);
					}
					else if(AntiAfk == 0)
				    {
				        SendClientMessage(playerid, COLOR_GREY, "* You have Turned on the Anti AFK detection!");
				        AntiAfk = 1;
				        format(string, sizeof(string), "[ADMIN]: %s has turned on the Anti AFK detection.",sendername);
				        ABroadCast(COLOR_LIGHTRED, string, 5);
					}
				}
Asta la Text Drawn
	Textdraw50 = TextDrawCreate(311.000000, 111.000000, "You are AFK. ~n~To Get Back Type Any Command ~n~or Press 'ENTER_VEHICLE' Key");
	TextDrawAlignment(Textdraw50, 2);
	TextDrawBackgroundColor(Textdraw50, -65281);
	TextDrawFont(Textdraw50, 1);
	TextDrawLetterSize(Textdraw50, 0.800000, 4.700000);
	TextDrawColor(Textdraw50, 255);
	TextDrawSetOutline(Textdraw50, 1);
	TextDrawSetProportional(Textdraw50, 1);
--------------------------------------------------------------------------------------------------------------------------------------------------------------- Si asta e comanda /afk
	if (strcmp(cmd, "/afk", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
			    if(AFK[playerid] == 0)
			    {
                    if(!IsPlayerInAnyVehicle(playerid))
					{
						 GetPlayerPos(playerid,TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
						 SafeSetPlayerPos(playerid, 0,0,2500);
					}
                    else
					{
						GetVehiclePos(idcar, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
						SetVehiclePos(GetPlayerVehicleID(playerid), 0,0,2500);
					}
					afkadmins ++;
			 		AFK[playerid] = 1;
			 		TogglePlayerControllable(playerid, 0);
			 		TextDrawShowForPlayer(playerid, Textdraw5);
					TextDrawShowForPlayer(playerid, Textdraw50);
		    		TextDrawHideForPlayer(playerid, Textdraw44);
		    		TextDrawHideForPlayer(playerid, Textdraw45);
		    		TextDrawHideForPlayer(playerid, Textdraw55);
		    		TextDrawHideForPlayer(playerid, Textdraw49[playerid]);
		    		TextDrawHideForPlayer(playerid, Textdraw51[playerid]);
		    		if(PlayerInfo[playerid][pWatch] == 1)
					{
						TextDrawHideForPlayer(playerid, Textdraw56);
						TextDrawHideForPlayer(playerid, Textdraw57);
						TextDrawHideForPlayer(playerid, Textdraw58);
					}
				}
				else
				{
				    if(!IsPlayerInAnyVehicle(playerid)) SafeSetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
                    else SetVehiclePos(idcar, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
			 		afkadmins --;
			 		AFK[playerid] = 0;
			 		TogglePlayerControllable(playerid, 1);
			 		TextDrawHideForPlayer(playerid, Textdraw5);
					TextDrawHideForPlayer(playerid, Textdraw50);
		    		TextDrawShowForPlayer(playerid, Textdraw44);
		    		TextDrawShowForPlayer(playerid, Textdraw45);
		    		TextDrawShowForPlayer(playerid, Textdraw49[playerid]);
		    		TextDrawShowForPlayer(playerid, Textdraw51[playerid]);
		    		TextDrawShowForPlayer(playerid, Textdraw55);
		    		if(PlayerInfo[playerid][pWatch] == 1)
					{
						TextDrawShowForPlayer(playerid, Textdraw56);
						TextDrawShowForPlayer(playerid, Textdraw57);
						TextDrawShowForPlayer(playerid, Textdraw58);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "* Access Denied.");
			}
		}
		return 1;
	}

Eu asta o am in GM si la 60 de secunde il baga automat pe jucator AFK

Respir si traiesc !

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.