I'm a bit rusty with timers...
#1

So recently I got back on scripting and apparently I can't even set the timers correctly!

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;
}
The textdraw won't show UNLESS I log in before spawning (while choosing class)
OR after I respawn after dying.

Help will be appreciated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)