21.01.2012, 12:50
So recently I got back on scripting and apparently I can't even set the timers correctly!
The textdraw won't show UNLESS I log in before spawning (while choosing class)
OR after I respawn after dying.
Help will be appreciated.
pawn Код:
public OnPlayerSpawn(playerid)
{
cdraw[playerid][UPD_Timer] = SetTimerEx("UPDATETIMER",2000,true,"i",playerid);
return 1;
}
pawn Код:
forward UPDATETIMER(playerid);
public UPDATETIMER(playerid)
{
if(pInfo[playerid][islogged] == 1)
{
format(cdraw[playerid][c_string],128,"Kills: %d~n~Deaths: %d~n~K/D Ratio: %d",pInfo[playerid][c_kills],pInfo[playerid][c_deaths],(pInfo[playerid][c_kills]/pInfo[playerid][c_deaths]));
TextDrawSetString(cdraw[playerid][Draw],cdraw[playerid][c_string]);
return TextDrawShowForPlayer(playerid,cdraw[playerid][Draw]);
}
return 1;
}
OR after I respawn after dying.
Help will be appreciated.