GetTickCount ?
#1

Is GetTickCount to count ? i mean what does it do exactly, is it When player Type /kill :
10 sec to die
9 sec to die
8 sec to die
or somthing like this ?
Reply
#2

no

https://sampwiki.blast.hk/wiki/GetTickCount
Returns the uptime of the actual server in milliseconds.
Reply
#3

It gets how many ticks have passed since the server started. It returns the uptime of the server in milliseconds.

For example, if the server has been open for two seconds, GetTickCount would return 2000. (1000 ms in one second)
Reply
#4

GetTickCount() returns the amount of milliseconds the machine your server is running has been up.

tickcount returns the amount of milliseconds that your sa-mp server has been up.

https://sampwiki.blast.hk/wiki/GetTickCount
https://sampwiki.blast.hk/wiki/Tickcount
Reply
#5

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
no

https://sampwiki.blast.hk/wiki/GetTickCount
Returns the uptime of the actual server in milliseconds.
Quote:
Originally Posted by [FMJ]PowerSurge
Посмотреть сообщение
It gets how many ticks have passed since the server started. It returns the uptime of the server in milliseconds.

For example, if the server has been open for two seconds, GetTickCount would return 2000. (1000 ms in one second)
Okey any another Example of it ?
And How could i make when player type /kill it count and send for player how many sec untill he died ?
Reply
#6

It's best to use a timer for that (SetTimerEx("Killplayer", 1000, 0, "i", playerid))

pawn Код:
new Killcount[MAX_PLAYERS];
pawn Код:
if(!strcmp("/kill", cmdtext, true))
{
    Killcount[playerid] = 10; // 10 seconds
    SetTimerEx("KillPlayer", 1000, 0, "i", playerid); //Check every second for Killcount.
    new str[10]; format(str, 10, "%d...", Killcount[playerid]);
    SendClientMessage(playerid, -1, str);
    return 1;
}
pawn Код:
forward KillPlayer(playerid);
public KillPlayer(playerid)
{
    switch(Killcount[playerid])
    {
        case 0: return SetPlayerHealth(playerid, 0.0);
        default:
        {
            SetTimerEx("KillPlayer", 1000, 0, "i", playerid);
            new str[10]; format(str, 10, "%d...", Killcount[playerid]);
            Killcount[playerid] -= 1;
            SendClientMessage(playerid, -1, str);
        }
    }
}
Reply
#7

Quote:
Originally Posted by [FMJ]PowerSurge
Посмотреть сообщение
It's best to use a timer for that (SetTimerEx("Killplayer", 1000, 0, "i", playerid))

pawn Код:
new Killcount[MAX_PLAYERS];
pawn Код:
if(!strcmp("/kill", cmdtext, true))
{
    Killcount[playerid] = 10; // 10 seconds
    SetTimerEx("KillPlayer", 1000, 0, "i", playerid); //Check every second for Killcount.
    new str[10]; format(str, 10, "%d...", Killcount[playerid]);
    SendClientMessage(playerid, -1, str);
    return 1;
}
pawn Код:
forward KillPlayer(playerid);
public KillPlayer(playerid)
{
    switch(Killcount[playerid])
    {
        case 0: return SetPlayerHealth(playerid, 0.0);
        default:
        {
            SetTimerEx("KillPlayer", 1000, 0, "i", playerid);
            new str[10]; format(str, 10, "%d...", Killcount[playerid]);
            Killcount[playerid] -= 1;
            SendClientMessage(playerid, -1, str);
        }
    }
}
I don`t think so this will work..
Reply
#8

Quote:
Originally Posted by [FMJ]PowerSurge
Посмотреть сообщение
It's best to use a timer for that (SetTimerEx("Killplayer", 1000, 0, "i", playerid))

pawn Код:
new Killcount[MAX_PLAYERS];
pawn Код:
if(!strcmp("/kill", cmdtext, true))
{
    Killcount[playerid] = 10; // 10 seconds
    SetTimerEx("KillPlayer", 1000, 0, "i", playerid); //Check every second for Killcount.
    new str[10]; format(str, 10, "%d...", Killcount[playerid]);
    SendClientMessage(playerid, -1, str);
    return 1;
}
pawn Код:
forward KillPlayer(playerid);
public KillPlayer(playerid)
{
    switch(Killcount[playerid])
    {
        case 0: return SetPlayerHealth(playerid, 0.0);
        default:
        {
            SetTimerEx("KillPlayer", 1000, 0, "i", playerid);
            new str[10]; format(str, 10, "%d...", Killcount[playerid]);
            Killcount[playerid] -= 1;
            SendClientMessage(playerid, -1, str);
        }
    }
}
Thanks But What does Mean
pawn Код:
Killcount[playerid] -= 1;
Reply
#9

Quote:
Originally Posted by Sanady
Посмотреть сообщение
I don`t think so this will work..
u are Right
Reply
#10

Quote:
Originally Posted by [FMJ]PowerSurge
Посмотреть сообщение
It's best to use a timer for that (SetTimerEx("Killplayer", 1000, 0, "i", playerid))

pawn Код:
new Killcount[MAX_PLAYERS];
pawn Код:
if(!strcmp("/kill", cmdtext, true))
{
    Killcount[playerid] = 10; // 10 seconds
    SetTimerEx("KillPlayer", 1000, 0, "i", playerid); //Check every second for Killcount.
    new str[10]; format(str, 10, "%d...", Killcount[playerid]);
    SendClientMessage(playerid, -1, str);
    return 1;
}
pawn Код:
forward KillPlayer(playerid);
public KillPlayer(playerid)
{
    switch(Killcount[playerid])
    {
        case 0: return SetPlayerHealth(playerid, 0.0);
        default:
        {
            SetTimerEx("KillPlayer", 1000, 0, "i", playerid);
            new str[10]; format(str, 10, "%d...", Killcount[playerid]);
            Killcount[playerid] -= 1;
            SendClientMessage(playerid, -1, str);
        }
    }
}
I recive Errors
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)