SA-MP Forums Archive
FPS textdraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: FPS textdraw (/showthread.php?tid=254033)



FPS textdraw - Face9000 - 08.05.2011

Hi all,is possible to have the FPS textdraw like this:



?

I already know how to create textdraw,but how updating with TextdrawSetString?

Thanks.


Re: FPS textdraw - Laronic - 08.05.2011

pawn Код:
new Text:FPS[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    FPS[playerid] = TextDrawCreate(240.0, 580.0, "Your FPS: Loading");
   
    TextDrawShowForPlayer(playerid, FPS[playerid]);
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new string[128]
    format(string, sizeof(string), "Your FPS: %d", GetPlayerFPS(playerid));
    TextDrawSetString(FPS[playerid], string);
    return 1;
}



Re: FPS textdraw - Face9000 - 08.05.2011

Love you.


Re: FPS textdraw - The Knight - 08.05.2011

or can also:
pawn Код:
public OnPlayerConnect( playerid )
{
   FPS[ playerid ] = TextDrawCreate( 240.0, 580.0, "Your FPS: Loading" );
   TextDrawShowForPlayer( playerid, FPS[ playerid ] );
   SetTimerEx( "@tKnight", 500, false, "i", playerid );
   return true;
}

forward @tKnight( playerid );
public @tKnight( playerid )
{
   new
         sStr[ 128 ];  
   format( sStr, sizeof( sStr ), "Your FPS: %d", GetPlayerFPS( playerid ) );  
   TextDrawSetString( FPS[ playerid ], sStr );
   return true;
}



Re: FPS textdraw - PotH3Ad - 09.05.2011

Quote:
Originally Posted by CyberGhost
Посмотреть сообщение
pawn Код:
new Text:FPS[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    FPS[playerid] = TextDrawCreate(240.0, 580.0, "Your FPS: Loading");
   
    TextDrawShowForPlayer(playerid, FPS[playerid]);
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new string[128]
    format(string, sizeof(string), "Your FPS: %d", GetPlayerFPS(playerid));
    TextDrawSetString(FPS[playerid], string);
    return 1;
}
Why such a big string size, it's only about 20 (or less) characters long -_-

pawn Код:
public OnPlayerUpdate(playerid)
{
    new string[20];
    format(string, sizeof(string), "Your FPS: %d", GetPlayerFPS(playerid));
    TextDrawSetString(FPS[playerid], string);
    return 1;
}
I recognize that textdraw btw, it's from Los Santos Gang Wars (LSGW)


Re: FPS textdraw - Face9000 - 09.05.2011

PotH3Ad get it .That server is awesome.


Re: FPS textdraw - Retardedwolf - 09.05.2011

Why not just use a 1second timer?


Re: FPS textdraw - Whitetiger - 09.05.2011

it uses a 4 second timer on lsgw if you're interested. but even increasing to 10 or 20 seconds wouldn't cause much harm.


Re: FPS textdraw - sciman001 - 09.05.2011

whats the GetPlayerFPS function from i need it!


Re: FPS textdraw - Retardedwolf - 10.05.2011

Quote:
Originally Posted by sciman001
Посмотреть сообщение
whats the GetPlayerFPS function from i need it!
JernejL's post from Scripting Tutorials I think.