11.04.2012, 18:35
How to create a Level System ?
EX.
My Minutes / Minutes for the next level... in textdraw look at the pic
HERE!
EX.
My Minutes / Minutes for the next level... in textdraw look at the pic
HERE!
forward OneMinute();
public OnGameModeInit()
{
SetTimer("OneMinute", 60000, 1);
return 1;
}
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;
}
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 ); } |