Level & Textdraw -
3RoR - 11.04.2012
How to create a Level System ?
EX.
My Minutes / Minutes for the next level... in textdraw look at the pic
HERE!
Re: Level & Textdraw -
Skribblez - 11.04.2012
Can you make this clear? You want the text-draw to be updated or you just want a level system?
Re: Level & Textdraw -
3RoR - 11.04.2012
A TextDraw for the level and a level with minutes to get the level
Re: Level & Textdraw -
Skribblez - 11.04.2012
It's just a matter of updating the text-draw string whenever the player obtains a minute and reaches a new level. Just use
TextDrawSetString() unless you haven't made the level system yet.
Re: Level & Textdraw -
3RoR - 11.04.2012
yes but y don't have a level system,can you give me a level system?(if you have)
Re: Level & Textdraw -
Skribblez - 11.04.2012
Well, from what you've posted, the only way that a player can level-up is by obtaining minutes which is obviously given every minute. So make a repeating timer for 1 minute.
Alright, let's start. First, declare a forward for the call-back.
Then set the timer
pawn Код:
public OnGameModeInit()
{
SetTimer("OneMinute", 60000, 1);
return 1;
}
For an explanation of the code above:
OneMinute would be the call-back as declared above,
60000 is the interval which is 1 minute, and the last parameter as
1 to identify it as repeating.
Next, let's create the actual call-back.
pawn Код:
public OneMinute()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
// Create your own variables which I assume that you already have for each player.
// That would be the enumeration(enum) on top of your script.
PlayerStats[i][pMinutes]++; // this is just an example, change it with your actual variable.
}
}
return 1;
}
On the call-back, it would loop through all the players online and would give them 1 point to their minutes variable.
Re: Level & Textdraw -
3RoR - 11.04.2012
Y have only this can you give me something ?
Quote:
pLevelSistem
forward Level();
SetTimer("Level",60000,true);
Public Level()
{
new i;
for(i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))
PlayerInfo[pLevelSistem] ++;
if(PlayerInfo [pLevelSistem] == 1)
{
PlayerInfo[pExp] ++;
PlayerInfo[pLevelSistem] = 0;
ShowClientMesssage(i, COLOR_LIGHTBLUE, "You earn 1 Minute for Playing on the server !");
}
}
}
OnPlayerRegister
format(var, 128, "Vreme=%d\n",PlayerInfo[playerid][pLevelSistem]);fwrite(hFile, var);
OnPlayerUpdate
format(var, 128, "Vreme=%d\n",PlayerInfo[playerid][pLevelSistem]);fwrite(hFile, var);
OnPlayerLogin
if( strcmp( key , "Vreme" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevelSistem] = strval( val ); }
|
don't matter the textdraw, can you make when a player has 20Minutes Played to Reach Next Level ?
EDIT:Can you make me an variable with
Player Minutes/20(To reach Next Level) ?
Does not need in Textdraw, to set it in /stats