Textdraw timer not work
#1

how to fix this ? this textdraw not moving

Код:
public OnPlayerSpawn(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
        	new string[128];
			format(string,sizeof(string),"~b~Score: ~y~%d ~b~Ping: ~y~%d ~b~FPS: ~y~%d ~b~Players: ~y~%d ~b~Skin: ~y~%d",GetPlayerScore(playerid),GetPlayerPing(playerid),GetPlayerFPS(playerid),GetOnLinePlayers(),GetPlayerSkin(playerid));
			TextDrawSetString(TextdrawInfo[playerid], string);
			TextDrawShowForPlayer(playerid, TextdrawInfo[playerid]);
			SetTimer("TexdrawInfo", 1000, 1);
        }
	}
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
    new string[128];
    format(string,sizeof(string),"~b~Score: ~y~%d ~b~Ping: ~y~%d ~b~FPS: ~y~%d ~b~Players: ~y~%d ~b~Skin: ~y~%d",GetPlayerScore(playerid),GetPlayerPing(playerid),GetPlayerFPS(playerid),GetOnLinePlayers(),GetPlayerSkin(playerid));
    TextDrawSetString(TextdrawInfo[playerid], string);
    TextDrawShowForPlayer(playerid, TextdrawInfo[playerid]);
    SetTimer("TexdrawInfo", 1000, 1);
    return 1;
}
You don't need to use loop, because you only need to show for player. Else, when a player get spawned, that textdraw will can be showed by all players. Not spawned players, etc.
And don't forget to show code in Textdraw Info. Try to set timer to 2 seconds (2000) because will be a little bit lagg with 1000.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)