HELP NEEDED!!
#1

Basically, i know this sounds noobish, but how could I make a person earn 1 point (score) for every minute they're online?

Thanks in advance!
Reply
#2

pawn Код:
forward score(playerid); //  TOP
pawn Код:
public OnPlayerConnect(playerid)
  {
  SetTimerEx("score", 60000, true, "i");
  return 1;
  }
pawn Код:
public score(playerid) // END
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
return 1;
}
Reply
#3

Your SetTimerEx should look like this

Код:
SetTimerEx("score", 60000, true, "d", playerid);
Reply
#4

Just a slight alteration to blackwave's solution so that it can handle player IDs being reused as players disconnect and connect.


pawn Код:
forward Score(playerid); // TOP
new gScoreTimer[MAX_PLAYERS]; // TOP
pawn Код:
public OnPlayerConnect(playerid)
{
  gScoreTimer[playerid] = SetTimerEx("Score", 60000, true, "i", playerid);
  return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid)
{
  KillTimer(gScoreTimer[playerid]);
  return 1;
}
pawn Код:
public Score(playerid) // END
{
  SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
  return 1;
}
Reply
#5

thanks it works fine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)