31.10.2011, 21:48
I am waaaay too tierd to even try to figure out myself. What is it wrong in here:
Timer is working. I've tested it with putting printf("TIMER TEST"); and indeed it worked. But when tried to do printf(string); it showed nothing. Also in the server TextDraw's string is not updating. Thanks to all helpers [REPUTATION ++]
pawn Код:
//Under OnPlayerConnect
SetTimerEx("StatsTimer",1000,1,"i",playerid);
//Somewhere.
forward StatsTimer(playerid);
public StatsTimer(playerid)
{
new string[128],Float:pH;
format(string,sizeof(string),"Kills: %i || Deaths: %i || Ratio: %f || Exp: %i || Gun: %s || Kills to top: %i",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],(PlayerInfo[playerid][pKills])/(PlayerInfo[playerid][pDeaths])
/* DO NOT TOUCH */,PlayerInfo[playerid][pExp],LevelToName(playerid),(hValue)-(PlayerInfo[playerid][pwSkills]));
printf(string);
TextDrawSetString(textdraw4,string);
GetPlayerHealth(playerid,pH);
SetPlayerHealth(playerid,pH+1);
return 1;
}