Originally Posted by MBilal
WTF is that dude you're using alot of timers this will ... any server.
Код:
public OnFilterScriptInit()
{
//Transmission Play time:-
SetTimer("TransMission",180000,false); //timers 180 x 1000 means that 180 sec { Extra about these transmission }
SetTimer("TransMission1",360000,false); // total of 180+180=360 False means that each timer wont repeat.
SetTimer("TransMission2",540000,false); // total of 360+180=540 Transmission 1,2,3 these numbers are not necessary but i added them to make a deatil.
SetTimer("TransMission3",660000,false); // total of 540+180=660
SetTimer("TransMission4",840000,false); // total of 660+180=840
SetTimer("TransMission5",960000,false); // total of 840+180=960
SetTimer("TransMission6",1140000,false); // total of 960+180=1140
SetTimer("TransMission7",1320000,false); // total of 1140+180=1320
SetTimer("TransMission8",1500000,false); // total of 1320+180=1500
SetTimer("TransMission9",1680000,false); // total of 1500+180=1680
//Sound Play time:-
SetTimerEx("PlaySound",180000,false,"i"); // same here as transmission comment
SetTimerEx("PlaySound1",360000,false,"i");
SetTimerEx("PlaySound2",540000,false,"i");
SetTimerEx("PlaySound3",660000,false,"i");
SetTimerEx("PlaySound4",840000,false,"i");
SetTimerEx("PlaySound5",960000,false,"i");
SetTimerEx("PlaySound6",1140000,false,"i");
SetTimerEx("PlaySound7",1320000,false,"i");
SetTimerEx("PlaySound8",1500000,false,"i");
SetTimerEx("PlaySound9",1680000,false,"i");
//Cp Play time:-
SetTimerEx("ShowCP",180000, false, "i"); // same here as transmission comment
SetTimerEx("ShowCP1",360000, false, "i");
SetTimerEx("ShowCP2",540000, false, "i");
SetTimerEx("ShowCP3", 660000, false, "i");
SetTimerEx("ShowCP4", 840000, false, "i");
SetTimerEx("ShowCP5", 960000, false, "i");
SetTimerEx("ShowCP6", 1140000, false, "i");
SetTimerEx("ShowCP7", 1320000, false, "i");
SetTimerEx("ShowCP8", 1500000, false, "i");
SetTimerEx("ShowCP9", 1680000, false, "i");
print("\n--------------------------------------");
print(" Transmission + Checkpint System Loaded.");
print("--------------------------------------\n");
return 1;
}
I recommend use only 1 timer and one function only
use switch statement in that function to show message use Counter
and soo on depend on message u want.
try to avoid thee timers.
Код:
public OnFilterScriptInit()
{
SetTimer("Function",10*60*1000,1);
return 1;
}
forward Function();
public Function()
{
switch(Counter)
{
Counter++;
case 1:
{
SendClientMessageToAll(RED,"~Radio TRANSMISSION~");
SendClientMessageToAll(GREEN,"If any Survivours is hearing this message");
SendClientMessageToAll(GREEN,"Please go to ____Glen Park___ for further assisstance");
SendClientMessageToAll(GREEN,"Umbrella Corp had setup their for survivors");
SendClientMessageToAll(GREEN,"We have Food and Medical Service");
SendClientMessageToAll(GREEN,"Please be safe while arriving here or zombies will hunt you down.");
PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/blb3aqymb1/Glen_park.mp3");
SetPlayerCheckpoint(playerid, 1969.99, -1199.42, 25.64, 50.0); //CheckPoint 1
return 1;
}
case 2:
{
SendClientMessageToAll(RED,"~Radio TRANSMISSION~");
SendClientMessageToAll(GREEN,"If any Survivours is hearing this message");
SendClientMessageToAll(GREEN,"Please go to ___Santa Maria Beach___ for further assisstance");
SendClientMessageToAll(GREEN,"Umbrella Corp had setup their for survivors");
SendClientMessageToAll(GREEN,"We have Food and Medical Service");
SendClientMessageToAll(GREEN,"Please be safe while arriving here or zombies will hunt you down.");
PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/346l57lq9m/Santa_beacg.mp3");
}
case 3:
{
}
case 4:
{
}
case 5:
{
}
}
return 1;
}
Don't forget to reset counter in last case you used.
also watch timers.
https://sampwiki.blast.hk/wiki/SetTimer
|