Timer help
#1

Error i get

Код:
E:\Documents and Settings\Nate\Desktop\Rebound-Roleplay\gamemodes\P-RP.pwn(3145) : error 028: invalid subscript (not an array or too many subscripts): "Pausetimer"
E:\Documents and Settings\Nate\Desktop\Rebound-Roleplay\gamemodes\P-RP.pwn(3145) : warning 215: expression has no effect
E:\Documents and Settings\Nate\Desktop\Rebound-Roleplay\gamemodes\P-RP.pwn(3145) : error 001: expected token: ";", but found "]"
E:\Documents and Settings\Nate\Desktop\Rebound-Roleplay\gamemodes\P-RP.pwn(3145) : error 029: invalid expression, assumed zero
E:\Documents and Settings\Nate\Desktop\Rebound-Roleplay\gamemodes\P-RP.pwn(3145) : fatal error 107: too many error messages on one line
pawn Код:
}
public OnPlayerPause(playerid)
{
    SetTimer("Pausetimer", 600000, false); // Set a timer of 1000 miliseconds (1 second)
    return 1;
}
public OnPlayerResume(playerid, time)
{
    KillTimer(Pausetimer[playerid]); line 3145
    SendClientMessage(playerid, COLOR_WHITE, "Welcome back!");
    return 1;
}
forward Pausetimer();
public Pausetimer()
{
    Kick(playerid);
    return 1;
}
Reply
#2

You need to read some more about Timers...

pawn Код:
new connect_timer[MAX_PLAYERS];
 
public OnPlayerConnect(playerid)
{
    print("Starting timer...");
    connect_timer[playerid] = SetTimerEx("WelcomeTimer", 5000, true, "i", playerid);
    return 1;
}
 
public OnPlayerDisconnect(playerid)
{
    KillTimer(connect_timer[playerid]);
    return 1;
}
 
forward WelcomeTimer(playerid);
public WelcomeTimer(playerid)
{
    SendClientMessage(playerid, -1, "Welcome!");
}
From the SAMP Wiki, showing that your KillTimer line, isn't how you are supposed to use it.
Reply
#3

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
You need to read some more about Timers...

pawn Код:
new connect_timer[MAX_PLAYERS];
 
public OnPlayerConnect(playerid)
{
    print("Starting timer...");
    connect_timer[playerid] = SetTimerEx("WelcomeTimer", 5000, true, "i", playerid);
    return 1;
}
 
public OnPlayerDisconnect(playerid)
{
    KillTimer(connect_timer[playerid]);
    return 1;
}
 
forward WelcomeTimer(playerid);
public WelcomeTimer(playerid)
{
    SendClientMessage(playerid, -1, "Welcome!");
}
From the SAMP Wiki, showing that your KillTimer line, isn't how you are supposed to use it.
Thx but as u se i want it so the timer start when player pause their game that's why i using

PHP код:
public OnPlayerPause(playerid
Reply
#4

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
Thx but as u se i want it so the timer start when player pause their game that's why i using

PHP код:
public OnPlayerPause(playerid
If you actually read what I brought up, you'd not focus on the fact that the timer is created OnPlayerConnect, rather look at the error you have made, in the KillTimer line, as I said...

pawn Код:
PlayerPause[playerid] = SetTimer("Pausetimer", 600000, false); // Set a timer of 1000 miliseconds (1 second)
pawn Код:
KillTimer(PlayerPause[playerid]);
Again though, if you'd actually read what was posted, you'd have found the point, rather than simply trying to make out what I'd posted was wrong.

You, could've gone to the wiki page yourself and read up on it, but you chose not to.
Reply
#5

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
If you actually read what I brought up, you'd not focus on the fact that the timer is created OnPlayerConnect, rather look at the error you have made, in the KillTimer line, as I said...

pawn Код:
PlayerPause[playerid] = SetTimer("Pausetimer", 600000, false); // Set a timer of 1000 miliseconds (1 second)
pawn Код:
KillTimer(PlayerPause[playerid]);
Again though, if you'd actually read what was posted, you'd have found the point, rather than simply trying to make out what I'd posted was wrong.

You, could've gone to the wiki page yourself and read up on it, but you chose not to.
Yeah i just focus to much on that, but now i understand what u was trying to tell me, thank you so much!!
Reply
#6

Good to see
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)