17.09.2011, 19:28
Or this:
But with lots of players in your server, its laggy (i think)
pawn Код:
#include <a_samp>
new bool:g_switch[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
g_switch[playerid] = true;
return true;
}
forward SwitchVar(playerid);
public SwitchVar(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)) g_switch[playerid] = true;
return true;
}
public OnPlayerUpdate(playerid)
{
if(g_switch[playerid])
{
g_switch[playerid] = false;
SetTimerEx("SwitchVar", 1000, false, "i", playerid);
SendClientMessage(playerid, -1, "Update/sec..");
}
return true;
}