Saving timers on players
#1

How can you save timer on a specific player? Such as for payday something like:

Код:
pPayTime = 60000
Meaning, the player has 6 minutes left till payday. So let's say you have 6 minutes, then I decide to /q. When I come back, i want timer to continue from how much time was left. How would you do something like this? Thanks in advance.
Reply
#2

use SetTimerEx and pass playerid as a parameter.
Reply
#3

I know how to create timers..I meant as in how do I detect how much time is like and how do I re-activate the timer to that specific number.
Reply
#4

Create a 1 minute timer. Each player have 60 minute to get the payday. If the player /q, save the remaining minute. Start the timer again if the player logged in.

Make a sense?
Reply
#5

use a global placeholder(variable) to hold the place of the creation timer and call it when you want to kill it.
Reply
#6

Add Another PlayerInfo File.. If im getting what ur saying ... Create a New file to users Account Like pPayday, and pHadPday,

And When the player returns Check OnPlayerLogged or What ever u have For showing the player Online and Logged it Have it check to see if the Player Had a payday If its 0 Have it Give them Last Payday...
After it gives them a Payday Make another User define name pHadPday, have it set it to 1 So if the player relogs he comes back it checks both files if pHadPday It wont give them another

For Example

pawn Код:
have a timer or ur login command call on PlayerLoggedOn(playerid);
public PlayerLoggedOn(playerid)
{

       if(PlayerInfo[playerid][pHadPday] == 1)
       {
           // Do Nothing
       }
       else if(PlayerInfo[playerid][pHadPday] == 0)
       {
             if(PlayerInfo[playerid][pPayday] == 1)
             {
                  //Do Nothing aswell
             }
             else if(PlayerInfo[playerid][pPayday] == 0)
             {
                 // Command to give them last payday
             }
      }
      return 1;
}

Yeah or Like =WoR=Varth Said..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)