SendClientMessage Seconds
#7

Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
Do you mean like this ? :-

SendClientMessage(s) Seconds (Code *Required*),
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "you have to stay 20 seconds");
SetTimer("twenty", 1000, 0);
SetTimer("nineteen", 2000, 0);
SetTimer("eighteen", 3000, 0);
SetTimer("seventeen", 4000, 0);
SetTimer("sixteen", 5000, 0);
SetTimer("fifteen", 6000, 0);
SetTimer("fourteen", 7000, 0);
SetTimer("thirteen", 8000, 0);
SetTimer("twelve", 9000, 0);
SetTimer("eleven", 10000, 0);
SetTimer("ten", 11000, 0);
SetTimer("nine", 12000, 0);
SetTimer("eight", 13000, 0);
SetTimer("seven", 14000, 0);
SetTimer("six", 15000, 0);
SetTimer("five", 16000, 0);
SetTimer("four", 17000, 0);
SetTimer("three", 18000, 0);
SetTimer("two", 19000, 0);
SetTimer("one", 20000, 0);
SetTimer("start", 21000, 0);
Forward and Public Callback for Countdown Timer for SendClientMessage(s) Seconds (without Freeze / UnFreeze),
pawn Код:
forward PlaySoundForPlayer(playerid, soundid);
public PlaySoundForPlayer(playerid, soundid)
{
    PlayerPlaySound(playerid,soundid, 0.0, 0.0, 0.0);
}

forward twenty(playerid);
public twenty(playerid)
{
        GameTextForPlayer(playerid, "~g~20",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward nineteen(playerid);
public nineteen(playerid)
{
        GameTextForPlayer(playerid, "~g~19",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward eighteen(playerid);
public eighteen(playerid)
{
        GameTextForPlayer(playerid, "~g~18",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward seventeen(playerid);
public seventeen(playerid)
{
        GameTextForPlayer(playerid, "~g~17",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward sixteen(playerid);
public sixteen(playerid)
{
        GameTextForPlayer(playerid, "~g~16",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward fifteen(playerid);
public fifteen(playerid)
{
        GameTextForPlayer(playerid, "~g~15",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward fourteen(playerid);
public fourteen(playerid)
{
        GameTextForPlayer(playerid, "~g~14",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward thirteen(playerid);
public thirteen(playerid)
{
        GameTextForPlayer(playerid, "~g~13",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward twelve(playerid);
public twelve(playerid)
{
        GameTextForPlayer(playerid, "~g~12",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}
forward eleven(playerid);
public eleven(playerid)
{
        GameTextForPlayer(playerid, "~g~11",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward ten(playerid);
public ten(playerid)
{
        GameTextForPlayer(playerid, "~g~10",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward eight(playerid);
public eight(playerid)
{
        GameTextForPlayer(playerid, "~g~9",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}
forward nine(playerid);
public nine(playerid)
{
        GameTextForPlayer(playerid, "~g~8",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward seven(playerid);
public seven(playerid)
{
        GameTextForPlayer(playerid, "~g~7",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward six(playerid);
public six(playerid)
{
        GameTextForPlayer(playerid, "~g~6",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward five(playerid);
public five(playerid)
{
        GameTextForPlayer(playerid, "~g~5",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward four(playerid);
public four(playerid)
{
        GameTextForPlayer(playerid, "~y~4",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward three(playerid);
public three(playerid)
{
        GameTextForPlayer(playerid, "~p~3",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward two(playerid);
public two(playerid)
{
        GameTextForPlayer(playerid, "~b~2",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward one(playerid);
public one(playerid)
{
        GameTextForPlayer(playerid, "~w~1",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}

forward start(playerid);
public start(playerid)
{
        GameTextForPlayer(playerid, "~b~Start !",2000,3);
        PlaySoundForPlayer(1138);
        return 1;
}
Forward and Public Callback for Countdown Timer for SendClientMessage(s) Seconds (with Freeze / UnFreeze),
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "you have to stay 20 seconds");
SetTimer("twenty", 1000, 0);
SetTimer("nineteen", 2000, 0);
SetTimer("eighteen", 3000, 0);
SetTimer("seventeen", 4000, 0);
SetTimer("sixteen", 5000, 0);
SetTimer("fifteen", 6000, 0);
SetTimer("fourteen", 7000, 0);
SetTimer("thirteen", 8000, 0);
SetTimer("twelve", 9000, 0);
SetTimer("eleven", 10000, 0);
SetTimer("ten", 11000, 0);
SetTimer("nine", 12000, 0);
SetTimer("eight", 13000, 0);
SetTimer("seven", 14000, 0);
SetTimer("six", 15000, 0);
SetTimer("five", 16000, 0);
SetTimer("four", 17000, 0);
SetTimer("three", 18000, 0);
SetTimer("two", 19000, 0);
SetTimer("one", 20000, 0);
SetTimer("start", 21000, 0);

forward PlaySoundForPlayer(playerid, soundid);
public PlaySoundForPlayer(playerid, soundid)
{
    PlayerPlaySound(playerid,soundid, 0.0, 0.0, 0.0);
}

forward twenty(playerid);
public twenty(playerid)
{
        GameTextForPlayer(playerid, "~g~20",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward nineteen(playerid);
public nineteen(playerid)
{
        GameTextForPlayer(playerid, "~g~19",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward eighteen(playerid);
public eighteen(playerid)
{
        GameTextForPlayer(playerid, "~g~18",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward seventeen(playerid);
public seventeen(playerid)
{
        GameTextForPlayer(playerid, "~g~17",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward sixteen(playerid);
public sixteen(playerid)
{
        GameTextForPlayer(playerid, "~g~16",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward fifteen(playerid);
public fifteen(playerid)
{
        GameTextForPlayer(playerid, "~g~15",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward fourteen(playerid);
public fourteen(playerid)
{
        GameTextForPlayer(playerid, "~g~14",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward thirteen(playerid);
public thirteen(playerid)
{
        GameTextForPlayer(playerid, "~g~13",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward twelve(playerid);
public twelve(playerid)
{
        GameTextForPlayer(playerid, "~g~12",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}
forward eleven(playerid);
public eleven(playerid)
{
        GameTextForPlayer(playerid, "~g~11",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward ten(playerid);
public ten(playerid)
{
        GameTextForPlayer(playerid, "~g~10",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward eight(playerid);
public eight(playerid)
{
        GameTextForPlayer(playerid, "~g~9",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}
forward nine(playerid);
public nine(playerid)
{
        GameTextForPlayer(playerid, "~g~8",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward seven(playerid);
public seven(playerid)
{
        GameTextForPlayer(playerid, "~g~7",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward six(playerid);
public six(playerid)
{
        GameTextForPlayer(playerid, "~g~6",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward five(playerid);
public five(playerid)
{
        GameTextForPlayer(playerid, "~g~5",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward four(playerid);
public four(playerid)
{
        GameTextForPlayer(playerid, "~y~4",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward three(playerid);
public three(playerid)
{
        GameTextForPlayer(playerid, "~p~3",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward two(playerid);
public two(playerid)
{
        GameTextForPlayer(playerid, "~b~2",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward one(playerid);
public one(playerid)
{
        GameTextForPlayer(playerid, "~w~1",2000,3);
        TogglePlayerControllable(playerid, 0);
        PlaySoundForPlayer(1138);
        return 1;
}

forward start(playerid);
public start(playerid)
{
        GameTextForPlayer(playerid, "~b~Start !",2000,3);
        TogglePlayerControllable(playerid, 1);
        PlaySoundForPlayer(1138);
        return 1;
}
This will lag the player like anything , because you are setting 20 timers together for the player...

Thats why we use a timer which repeats itself so that it reduces lag because system doesnt need to handle 20 timers together there ....

I am not telling you are wrong but your code will lag the player for much time. I have used it too thats why i am telling.
Reply


Messages In This Thread
SendClientMessage Seconds - by AnonScripter - 11.11.2013, 09:30
Re: SendClientMessage Seconds - by Tagathron - 11.11.2013, 09:36
Re: SendClientMessage Seconds - by AnonScripter - 11.11.2013, 09:46
Re: SendClientMessage Seconds - by Tagathron - 11.11.2013, 09:55
Re: SendClientMessage Seconds - by -=Dar[K]Lord=- - 11.11.2013, 09:57
Re: SendClientMessage Seconds - by SAMProductions - 11.11.2013, 10:02
Re: SendClientMessage Seconds - by -=Dar[K]Lord=- - 11.11.2013, 10:06

Forum Jump:


Users browsing this thread: 1 Guest(s)