Timer doesn't work??
#1

Код:
public OnGameModeInit()
{
SetTimer("pViplaikas",60000,true);
My enum:

Код:
INI_Int("VipoLaikas",PlayerInfo[playerid][pViplaikas]);
Код:
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pVip])
PlayerInfo[playerid][pViplaikas] --;
When i spawn, i get -1 minute, but only when i spawn, when i just playing, time doesn't decreasing..
Reply
#2

Hmmm. SetTimer("pViplaikas",60000,true);
Show us your pViplaikas public ?
Reply
#3

Quote:
Originally Posted by [D]ry[D]esert
Посмотреть сообщение
Hmmm. SetTimer("pViplaikas",60000,true);
Show us your pViplaikas public ?
You mean this?
Код:
forward pViplaikas(playerid);
public pViplaikas(playerid);
If i write this code, i get errors:

C:\Users\Lauryno\Desktop\Servas\gamemodes\bom.pwn( 52) : error 021: symbol already defined: "pViplaikas"
C:\Users\Lauryno\Desktop\Servas\gamemodes\bom.pwn( 53) : error 021: symbol already defined: "pViplaikas"
Reply
#4

Use different name on the enum and on the timer.
You need to have the forward/public only one time on your script. According to the errors, these symbols already defined.
Reply
#5

pawn Код:
SetTimer("You Shall put CALLBACK name Not a Variable.",time,false or true);
Reply
#6

I renamed timer to SetTimer("Viplaikas",60000,true); but the same shit..
Reply
#7

Did you only renamethe name from the timer? Did you also rename the forward/public name?
Reply
#8

As i guess this what you mean..
pawn Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("pViplaikasAdd",60000,true,"i",playerid);
rest of your code..
}
forward pViplaikasAdd(playerid);
public pViplaikasAdd(playerid)
    {
    if(PlayerInfo[playerid][pVip])
        {
        PlayerInfo[playerid][pViplaikas] --;
        }
              }
Reply
#9

Quote:
Originally Posted by [D]ry[D]esert
Посмотреть сообщение
As i guess this what you mean..
pawn Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("pViplaikasAdd",60000,true,"i",playerid);
rest of your code..
}
forward pViplaikasAdd(playerid);
public pViplaikasAdd(playerid)
    {
    if(PlayerInfo[playerid][pVip])
        {
        PlayerInfo[playerid][pViplaikas] --;
        }
              }
Mhm, i using your code, but pViplaikas isn't decreasing.. When i disconnect from server, i get -1 pViplaikas.
Reply
#10

Any ideas?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)