27.07.2012, 00:51
Quote:
Maybe, it could be that the public is before the timer is being set
|
EDIT: Tested it, didn't work either.
pawn Код:
#include <a_samp>
#include <streamer>
#pragma tabsize 0
#define FILTERSCRIPT
#if defined FILTERSCRIPT
new MainObjects[3];
new Counter;
new GreenLasterTime;
new GreenLaser[9];
forward GreenLasers();
public OnFilterScriptInit()
{
/* Main Objects */
MainObjects[0] = CreateObject(3494, 243.00, -1854.50, 6.10, 0.00, 0.00, 0.00);
MainObjects[1] = CreateObject(2232, 243.57, -1853.25, 2.77, 0.00, 0.00, 155.28);
MainObjects[2] = CreateObject(2232, 242.64, -1853.24, 2.77, 0.00, 0.00, 204.12);
Counter = 0;
return 1;
}
public OnFilterScriptExit()
{
/* Main Objects */
DestroyObject(MainObjects[0]);
DestroyObject(MainObjects[1]);
DestroyObject(MainObjects[2]);
/* Timers */
KillTimer(GreenLasterTime);
/* Green Lasers */
DestroyObject(GreenLaser[0]);
DestroyObject(GreenLaser[1]);
DestroyObject(GreenLaser[2]);
DestroyObject(GreenLaser[3]);
DestroyObject(GreenLaser[4]);
DestroyObject(GreenLaser[5]);
DestroyObject(GreenLaser[6]);
DestroyObject(GreenLaser[7]);
DestroyObject(GreenLaser[8]);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/beginevent",true)==0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
Counter = 0;
PlayAudioStreamForPlayer(i, "http://****************", 249.7234, -1852.3114, 2.7695, 500, 1);
GreenLasterTime = SetTimer("GreenLasers", 1000, 1); // Set a timer of 1000 miliseconds (1 second)
}
}
return 1;
}
return 0;
}
public GreenLasers()
{
if(Counter == 86) {
GreenLaser[0] = CreateObject(19083, 242.92, -1855.00, 10.32, 0.00, 0.00, 76.92);
Counter++;
} else if(Counter == 87) {
GreenLaser[1] = CreateObject(19083, 242.92, -1855.00, 10.32, 0.00, 0.00, 79.98);
Counter++;
} else if(Counter == 88) {
GreenLaser[2] = CreateObject(19083, 242.92, -1855.00, 10.32, 0.00, 0.00, 83.04);
Counter++;
} else if(Counter == 89) {
GreenLaser[3] = CreateObject(19083, 242.92, -1855.00, 10.32, 0.00, 0.00, 85.92);
Counter++;
} else if(Counter == 90) {
GreenLaser[4] = CreateObject(19083, 242.92, -1855.00, 10.32, 0.00, 0.00, 89.04);
Counter++;
} else if(Counter == 91) {
GreenLaser[5] = CreateObject(19083, 242.92, -1855.00, 10.32, 0.00, 0.00, 92.34);
Counter++;
} else if(Counter == 92) {
GreenLaser[6] = CreateObject(19083, 242.92, -1855.00, 10.32, 0.00, 0.00, 95.64);
Counter++;
} else if(Counter == 93) {
GreenLaser[7] = CreateObject(19083, 242.92, -1855.00, 10.32, 0.00, 0.00, 99.12);
Counter++;
} else if(Counter == 94) {
GreenLaser[8] = CreateObject(19083, 242.92, -1855.00, 10.32, 0.00, 0.00, 102.84);
Counter++;
} else if(Counter == 96) {
MoveObject(GreenLaser[0], 242.91, -1855.00, 10.32, 4.00, 0.00, 12.00, 76.92);
MoveObject(GreenLaser[1], 242.91, -1855.00, 10.32, 4.00, 0.00, 12.00, 79.98);
MoveObject(GreenLaser[2], 242.91, -1855.00, 10.32, 4.00, 0.00, 12.00, 83.04);
MoveObject(GreenLaser[3], 242.91, -1855.00, 10.32, 4.00, 0.00, 12.00, 85.92);
MoveObject(GreenLaser[4], 242.91, -1855.00, 10.32, 4.00, 0.00, 12.00, 89.04);
MoveObject(GreenLaser[5], 242.91, -1855.00, 10.32, 4.00, 0.00, 12.00, 92.34);
MoveObject(GreenLaser[6], 242.91, -1855.00, 10.32, 4.00, 0.00, 12.00, 95.64);
MoveObject(GreenLaser[7], 242.91, -1855.00, 10.32, 4.00, 0.00, 12.00, 99.12);
MoveObject(GreenLaser[8], 242.91, -1855.00, 10.32, 4.00, 0.00, 12.00, 102.84);
Counter++;
} else if(Counter == 99) {
MoveObject(GreenLaser[0], 242.92, -1855.00, 10.32, 4.00, 0.00, -12.00, 76.92);
MoveObject(GreenLaser[1], 242.92, -1855.00, 10.32, 4.00, 0.00, -12.00, 79.98);
MoveObject(GreenLaser[2], 242.92, -1855.00, 10.32, 4.00, 0.00, -12.00, 83.04);
MoveObject(GreenLaser[3], 242.92, -1855.00, 10.32, 4.00, 0.00, -12.00, 85.92);
MoveObject(GreenLaser[4], 242.92, -1855.00, 10.32, 4.00, 0.00, -12.00, 89.04);
MoveObject(GreenLaser[5], 242.92, -1855.00, 10.32, 4.00, 0.00, -12.00, 92.34);
MoveObject(GreenLaser[6], 242.92, -1855.00, 10.32, 4.00, 0.00, -12.00, 95.64);
MoveObject(GreenLaser[7], 242.92, -1855.00, 10.32, 4.00, 0.00, -12.00, 99.12);
MoveObject(GreenLaser[8], 242.92, -1855.00, 10.32, 4.00, 0.00, -12.00, 102.84);
Counter++;
} else if(Counter == 102) {
MoveObject(GreenLaser[0], 242.92, -1855.00, 10.32, 4.00, 0.00, 0.00, 76.92);
MoveObject(GreenLaser[1], 242.92, -1855.00, 10.32, 4.00, 0.00, 0.00, 79.98);
MoveObject(GreenLaser[2], 242.92, -1855.00, 10.32, 4.00, 0.00, 0.00, 83.04);
MoveObject(GreenLaser[3], 242.92, -1855.00, 10.32, 4.00, 0.00, 0.00, 85.92);
MoveObject(GreenLaser[4], 242.92, -1855.00, 10.32, 4.00, 0.00, 0.00, 89.04);
MoveObject(GreenLaser[5], 242.92, -1855.00, 10.32, 4.00, 0.00, 0.00, 92.34);
MoveObject(GreenLaser[6], 242.92, -1855.00, 10.32, 4.00, 0.00, 0.00, 95.64);
MoveObject(GreenLaser[7], 242.92, -1855.00, 10.32, 4.00, 0.00, 0.00, 99.12);
MoveObject(GreenLaser[8], 242.92, -1855.00, 10.32, 4.00, 0.00, 0.00, 102.84);
Counter++;
} else if(Counter == 105) {
DestroyObject(GreenLaser[0]);
DestroyObject(GreenLaser[1]);
DestroyObject(GreenLaser[2]);
DestroyObject(GreenLaser[3]);
DestroyObject(GreenLaser[4]);
DestroyObject(GreenLaser[5]);
DestroyObject(GreenLaser[6]);
DestroyObject(GreenLaser[7]);
DestroyObject(GreenLaser[8]);
Counter++;
} else {
Counter++;
}
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}