Help: How to make... (see topic)
#6

Try something like this.

pawn Код:
#include<a_samp>

new
      TabTimer[MAX_PLAYERS],
      Tabbed[MAX_PLAYERS]
;

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

public OnPlayerDisconnect(playerid)
{
    KillTimer(TabTimer[playerid]);
    return 1;
}

public OnPlayerUpdate(playerid)
{
     Tabbed[playerid] = 0;
     return 1;
}

// Put this under where you spawn the player (SpawnPlayer(playerid)) for the first time (NOT IN ONPLAYERSPAWN! if you put it in OnPlayerSpawn, it will start this timer EVERYTIME the player is spawned)

TabTimer[playerid] = SetTimerEx("TabbedCheck", 1000, true, "i", playerid);

// The callback for the timer above.

forward TabbedCheck(playerid);
public TabbedCheck(playerid)
{
     Tabbed[playerid] += 1;
     return 1;
}

// Now, add this right before where the EXP is given. The "30" seen below means if they have been tabbed for 30 or more seconds, they will not gain EXP.

if(Tabbed[playerid] >= 30) return 1;
Hope this helps.
Reply


Messages In This Thread
Help: How to make... (see topic) - by NeroX98 - 09.06.2012, 17:06
Re: Help: How to make... (see topic) - by MarinacMrcina - 09.06.2012, 17:07
Re: Help: How to make... (see topic) - by JhnzRep - 09.06.2012, 17:08
Re: Help: How to make... (see topic) - by NeroX98 - 09.06.2012, 17:55
Re: Help: How to make... (see topic) - by NeroX98 - 13.11.2012, 22:10
Re: Help: How to make... (see topic) - by Kreyg - 14.11.2012, 02:09

Forum Jump:


Users browsing this thread: 1 Guest(s)