Timer problem
#1

Hi all, I have a problema with a timer, when I start mi server on Windows the timer run, but when I upload the script to the Linux server the timer not work, here is the code. Can you help me please?


Quote:

#include <a_samp>
#include <streamer>

new nav, rep;
#define TIEMPO 74000


public OnFilterScriptInit()
{
nav = CreateDynamicRectangle(1439.881713, -1725.621459, 1511.881713, -1613.621459, -1, -1, -1);
return 1;
}

public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(areaid == nav)
{
PlayAudioStreamForPlayer(playerid,"https://dl.dropboxusercontent.com/u/63921548/Navidad.mp3");
rep = SetTimer("repetir", TIEMPO, true);
}
return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
if(areaid == nav)
{
StopAudioStreamForPlayer(playerid);
KillTimer(rep);
}
return 1;
}


forward repetir(playerid);
public repetir(playerid)
{
PlayAudioStreamForPlayer(playerid,"https://dl.dropboxusercontent.com/u/63921548/Navidad.mp3");
}

Reply
#2

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#3

I already did, but when I leave dinamic area the music keeps repeating.
Reply
#4

You must use array for every single player

Top
pawn Код:
new rep[MAX_PLAYERS];
Enter
pawn Код:
KillTimer(rep[playerid]);
rep[playerid] = SetTimerEx(...
Leave
pawn Код:
KillTimer(rep[playerid]);
Reply
#5

Perfect!, it works!, thanks man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)