18.08.2011, 12:12
pawn Код:
#include "a_samp"
new pCount[MAX_PLAYERS];
new pTimer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
pCount[playerid] = 0;
return true;
}
public OnPlayerDisconnect(playerid, reason)
{
pCount[playerid] = 0;
return true;
}
public OnPlayerEnterCheckpoint(playerid)
{
pTimer[playerid] = SetTimerEx("CapturinZones", 1000, true, "d", playerid);
return true;
}
public OnPlayerLeaveCheckpoint(playerid)
{
KillTimer(pTimer[playerid]);
return true;
}
forward CapturinZones(playerid);
public CapturinZones(playerid)
{
pCount[playerid] += 1;
switch(pCount[playerid])
{
case 20:
{
// Your code to Capture zone.
pCount[playerid] = 0;
KillTimer(pTimer[playerid]);
}
}
return true;
}