SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 22/10/2009, 05:56 AM   #1
BLAbla93
Huge Clucker
 
Join Date: Jan 2009
Posts: 213
Reputation: 4
Default NPC help with my idle timer

ok i have a npc i made i added the

Code:
if(IsPlayerNPC(playerid)) return 1;
to the login...

the issue i am having is that my idle timer to keep inactive players from getting score and playing time has a auto kick and its causing the npc to stay at the spawn ...

Idle Timer Code
Code:
public IdleTimer()
{
	new pName[MAX_PLAYER_NAME], string[256];
	new Float:X, Float:Y, Float:Z;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
	  {
			if(pSettings[i][IdleStatus] == 0)
			{
				if(pSettings[i][FirstCheck]==0)
			  {
			    GetPlayerPos(i, IdlePos[i][0], IdlePos[i][1], IdlePos[i][2]);
			    pSettings[i][FirstCheck]=1;
				}
				else
				{
				  GetPlayerPos(i, X, Y, Z);
				  if(X == IdlePos[i][0] && Y == IdlePos[i][1] && Z == IdlePos[i][2])
				  {
					  if(pSettings[i][IdleTime] < 60)
					  {
					    pSettings[i][IdleTime]++;
						}
						else
						{
						  pSettings[i][IdleStatus] = 1;
						  SendClientMessage(i, COLOR_SKYBLUE, "- Your Status Has Changed. (Away)");
						  pSettings[i][IdleTime]=0;
						  pSettings[i][FirstCheck]=0;
						}
					}
					else
					{
					  pSettings[i][FirstCheck]=0;
					  pSettings[i][IdleTime]=0;
					}
				}
			}
			else
			{
			  GetPlayerPos(i, X, Y, Z);
			  if(X != IdlePos[i][0] && Y != IdlePos[i][1])
			  {
					SendClientMessage(i, COLOR_SKYBLUE, "- Your Status Has Changed. (Active)");
					pSettings[i][IdleStatus]=0;
					pSettings[i][IdleTime]=0;
				}
				else
				{
				  if(pSettings[i][IdleTime] < 1200)
				  {
				    pSettings[i][IdleTime]++;
					}
					else
					{
						GetPlayerName(i,pName,sizeof(pName));
						format(string,sizeof(string),"SERVER: %s (%d) Has Been Away For More Then 20 Minutes And Was Kicked.",pName,i);
						SendClientMessageToAll(COLOR_SKYBLUE, string);
						Kick(i);
					}
				}
			}
		}
	}
}
now before you say add the
Code:
if(IsPlayerNPC(playerid)) return 1;
i have tried this and returned the other value but i am getting the error saying

Code:
C:\Documents and Settings\Desktop\SAMP\gamemodes\SuperStunt.pwn(5119) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
any will be appreciated

thanks blabla93
BLAbla93 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer :P lionlev Help Archive 2 28/03/2010 12:47 PM
Running a server idle? FrostBytez Server Support 2 03/01/2010 05:31 AM
Detecting if a person is idle. Abernethy Help Archive 5 05/09/2009 11:51 AM
Timer JoeDaDude Help Archive 6 22/04/2009 07:27 PM


All times are GMT. The time now is 10:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.