Jump to content

Question

Posted

Salut care ma ajuta si pe mine cu un sistem auto afk adica cand dai esc sau iesi in bara sa se schimbe culoare in negru si cand intri in joc sa-ti revina culoarea.Multumesc!!

6 answers to this question

Recommended Posts

Posted

Salut,sa inventat butonul Search,si Regulementul care spune sa nu cerem scripturi/Gm-uri/Mape/Etc..

Sunt miiiii de scripturi pentur auto afk,si ce mai vrei u,cauta pe sa-mp.ro si sa-mp.com

Posted

http://www.sa-mp.ro/forum/index.php/topic,4419.msg29581.html#msg29581

Doar ce am scris auto afk la search si mia gasit pe sa-mp.ro,citeste cu atentie scrie

Are un sistem de autoafk

Posted

Am facut asa si nu merge nu se pune afk si cu , culoare neagra

// By Hunter
// Please do not remove the credits

#include <a_samp>

#define FILTERSCRIPT
#define COLOR_AFK 0x5A5454FF
new afk[MAX_PLAYERS];
new afktime = 1000;//10 mins
new afktimer;
new Float:AFKPos[MAX_PLAYERS][6];
new invafk[MAX_PLAYERS];

forward AutoAFK();


public OnFilterScriptInit()
{
	printf("\n--------------------------------------");
	printf("-------- AFK sistem by Hunter --------");
	printf("--------------------------------------\n");
	afktimer = SetTimer("AutoAFK", afktime, 1);
	return 1;
}

public OnFilterScriptExit()
{
	KillTimer(afktimer);
	return 1;
}



public OnPlayerConnect(playerid)
{
	afk[playerid] = 0;
	invafk[playerid] = 0;
	return 1;
}

public OnRconCommand(cmd[])
{
	new string[256];
    if (strcmp("/kickallafk", cmd, true) == 0)
	{
	    	for(new i = 0; i < MAX_PLAYERS; i++)
			{
			    if(afk[i] == 1 || invafk[i] == 1)
			    {
			        new name[128];
			        GetPlayerName(i,name,128);
					format(string,256, "%s has kicked all AFK players.",name);
					SendClientMessage(i,0xFF6347AA,string);
					printf(string);
					Kick(i);
				}
			}


			return 1;
	}
	return 0;
}

public AutoAFK()
{

    for(new i = 0; i < MAX_PLAYERS; i++)
	{
		GetPlayerPos(i, AFKPos[i][0], AFKPos[i][1], AFKPos[i][2]);
		AFKPos[i][3] = AFKPos[i][0];
		AFKPos[i][4] = AFKPos[i][1];
		AFKPos[i][5] = AFKPos[i][2];
		if(AFKPos[i][0] == AFKPos[i][3] && AFKPos[i][1] == AFKPos[i][4] && AFKPos[i][2] == AFKPos[i][5] && afk[i] == 0)
		{
		        SetPlayerColor(i,COLOR_AFK);
				afk[i] = 1;
		}
		else if(AFKPos[i][0] != AFKPos[i][3] && AFKPos[i][1] != AFKPos[i][4] && AFKPos[i][2] != AFKPos[i][5] && afk[i] == 1)
		{
		        while (afk[i] == 0)
	    		{
	    			new color = GetPlayerColor(i);
	    			SetPlayerColor(i,color);
	    		}
		        afk[i] = 0;
		}
	}
}

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.