Timer problem
#1

I want to create a timer for this public:
pawn Код:
forward matspick(playerid);
public matspick(playerid)
{
    for(new i = 0; i < sizeof(DropInfo); i++)
    {
        if (PlayerToPoint(1.0,playerid,DropInfo[i][dx],DropInfo[i][dy],DropInfo[i][dz]))
        {
            if(GetPlayerVirtualWorld(playerid) == DropInfo[i][dWorld])
            {
                DestroyObject(DropObject[i]);
                DropInfo[i][dx] = 0.0;
                DropInfo[i][dy] = 0.0;
                DropInfo[i][dz] = 0.0;
                if(DropInfo[i][dType] == 4) // Crack
                {
                    new string[256];
                    format(string,sizeof(string),"* %s picks up %d materials.",Name(playerid),DropInfo[i][dAmount]);
                    ProxDetector(30.0,playerid,string,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
                    PlayerInfo[playerid][pMats] += DropInfo[i][dAmount][0];
                    DropInfo[i][dAmount][0] = 0;
                    DropInfo[i][dAmount][1] = 0;
                    DropInfo[i][dType] = 0;
                }
            }
        }
    }
}
Reply
#2

Do not Create double topics
i told you, you must show me Where you define DropInfo?
Reply
#3

I fixed the old problem and I need to create a timer
Reply
#4

pawn Код:
static playertimer[MAX_PLAYERS];
#define TimerInterval 5000 //Type your interval here (MS)
#define reapiting 1 //You want to timer repeat? use 1 else 0
public OnPlayerConnect(playerid)
{
playertimer[playerid] = SetTimerEx("matspick", TimerInterval, reapiting, "i", playerid);
return 1;
}

public OnPlayerDisconnect(playerid)
{
KillTimer(playertimer[playerid]);
return 1;
}
Also see here: SetTimerEx
Reply
#5

pawn Код:
enum dInfo
{
    dType,
    dAmount[2],
    Float:dx,
    Float:dy,
    Float:dz,
    dWorld,
    dPlayerName[MAX_PLAYER_NAME],
};

new DropInfo[3000][dInfo];
new DropObject[3000];
Reply
#6

I want to but the timer in command '/grab' after animation
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)