SA-MP Forums Archive
Problem with other player - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with other player (/showthread.php?tid=617533)



Problem with other player - Cr4nh - 22.09.2016

Hello.

I have a problem, i dont know why.

I have system where after 60 seconds player dont have activity sending him in AFK mod.
Problem is here:

Im ID:0, server sending me in afk mod after no activity, but ID: 1 (friend) him not send in AFK mod.

Код:
	if(IsPlayerConnected(playerid))
	{
		if(IsLogged[playerid] == true)
		{
			if(inactivetime[playerid] > 60000 && AFKstatus[playerid] == 0)
			{
				AFKstatus[playerid] = 1;

        		new sstring[124];
        		format(sstring, sizeof(sstring), "[SERVER]: "COL_GREY"%s [ID:%d] je prebacen u AFK mod radi neaktivnosti 2 minute.", GetName(playerid), playerid);
        		SendMessageToStaff(COLOR_ADMINPURPLE, sstring);

	    		SendClientMessage(playerid, COLOR_ORANGE, "[SERVER]: "COL_WHITE"Server vas je prebacio u AFK mod radi duze neaktivnosti od 2 minute.");
            }
		}
	}
	
	if(IsPlayerConnected(playerid))
	{
		if(IsLogged[playerid] == true)
		{
			if(inactivetime[playerid] < 60000 && AFKstatus[playerid] == 1)
			{
				AFKstatus[playerid] = 0;

        		new sstring[124];
        		format(sstring, sizeof(sstring), "[SERVER]: "COL_GREY"%s [ID:%d] vise nije u AFK modu.", GetName(playerid), playerid);
        		SendMessageToStaff(COLOR_ADMINPURPLE, sstring);

	    		SendClientMessage(playerid, COLOR_ORANGE, "[SERVER]: "COL_WHITE"Vise niste u AFK modu.");
            }
		}
	}
this is on timer. ( 1 second ) on this timer is where server giving to player +1000 for no activity


Re: Problem with other player - Shinja - 22.09.2016

Where this code is placed


Re: Problem with other player - Cr4nh - 22.09.2016

This is placed here:
Код:
public Glob1SecPT1(playerid)
on OnGameModeInit i have timer

Код:
SetTimer("Glob1SecPT1", 1000, true)



Re: Problem with other player - Shinja - 22.09.2016

Do onplayerconnect
PHP код:
SetTimerEx("Glob1SecPT1"1000true"i"playerid); 



Re: Problem with other player - Cr4nh - 24.09.2016

Okay, thanks