28.01.2015, 21:43
en ongamemodeinit estбs usando un timer sin parametros
esto servirнa asн:
Pero tu lo tienes asн:
la solucion, un bucle en ongamemodeinit o en setlevel().
si es en ongamemodeinit serнa asн:
O de la otra manera como lo tienes serнa asн:
pawn Код:
SetTimer("setlevel", 1000, true);
pawn Код:
public setlevel()
pawn Код:
public setlevel(playerid)
si es en ongamemodeinit serнa asн:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetTimerEx("setlevel",1000,true,"i",i);
}
pawn Код:
SetTimer("setlevel", 1000, true);
public setlevel()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
new string[256];
if(Player[playerid][Level] == Player[playerid][MaxLevel])
{
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
Player[playerid][PlayerScore] = GetPlayerScore(playerid);
Player[playerid][Level] = 0;
Player[playerid][MaxLevel] = Player[playerid][MaxLevel]+11;
format(string, sizeof(string), "Felicidades has subido un nivel, ahora eres nivel %d.", Player[playerid][PlayerScore]);
SendClientMessage(playerid, WHITE, string);
}
format(string, sizeof(string), "Nivel: %d", Player[playerid][PlayerScore]);
TextDrawSetString(Nivel, string);
format(string, sizeof(string), "Exp: %d/%d", Player[playerid][Level], Player[playerid][MaxLevel]);
TextDrawSetString(Exp, string);
format(string, sizeof(string), "Tel: %d", Player[playerid][PhoneN]);
TextDrawSetString(Tel, string);
if(Player[playerid][SecondsToLevel] == 0)
{
Player[playerid][SecondsToLevel] = 3600;
Player[playerid][Level]++;
}
}
}