SA-MP Forums Archive
[FilterScript] Simple Health Textdraw by S4ba - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Simple Health Textdraw by S4ba (/showthread.php?tid=425989)



Simple Health Textdraw by S4ba - S4ba - 27.03.2013

Created by: S4ba

Picture:

Download:
pawn Код:
#include <a_samp>

new Text:Health[MAX_PLAYERS];

forward vitals(playerid);

public OnGameModeInit()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    Health[i] = TextDrawCreate(548.000000, 67.000000, "%100");
    TextDrawBackgroundColor(Health[i], 255);
    TextDrawFont(Health[i], 1);
    TextDrawLetterSize(Health[i], 0.290000, 0.799999);
    TextDrawColor(Health[i], -1);
    TextDrawSetOutline(Health[i], 0);
    TextDrawSetProportional(Health[i], 1);
    TextDrawSetShadow(Health[i], 1);
    }
    SetTimer("vitals",1000,1);
    return 1;
}

public vitals(playerid)
{
    new string[5];
    new Float:pHealth;
    GetPlayerHealth(playerid,pHealth);
    format(string, sizeof(string), "%.0f%", pHealth);
    TextDrawSetString(Health[playerid], string);
}



Re: Simple Health Textdraw by S4ba - Player23 - 27.03.2013

Nice


Re: Simple Health Textdraw by S4ba - Private200 - 27.03.2013

I don't think this is yours, but I think you just stole it from somewhere and published it here.
Why you're using "OnGameModeInIt" in a filterscript?

Private200


Re: Simple Health Textdraw by S4ba - S4ba - 27.03.2013

Quote:
Originally Posted by Private200
Посмотреть сообщение
I don't think this is yours, but I think you just stole it from somewhere and published it here.

Private200
your problem..

Quote:

Why you're using "OnGameModeInIt" in a filterscript?

why not?


Re: Simple Health Textdraw by S4ba - Private200 - 27.03.2013

Quote:
Originally Posted by S4ba
Посмотреть сообщение
why not?
OnGameModeInIt is being used only when you're going to create a gamemode with these codes. But not, you're going to create a filterscript right now, so there's need of "OnFilterScriptInIt()".

Private200


Re: Simple Health Textdraw by S4ba - S4ba - 27.03.2013

Quote:
Originally Posted by Private200
Посмотреть сообщение
OnGameModeInIt is being used only when you're going to create a gamemode with these codes. But not, you're going to create a filterscript right now, so there's need of "OnFilterScriptInIt()".

Private200
it works also with OnGameModeInit()

lol

try it!


Re: Simple Health Textdraw by S4ba - Joksa - 27.03.2013

simple but good


Re: Simple Health Textdraw by S4ba - S4ba - 27.03.2013

yeah, thx


AW: Simple Health Textdraw by S4ba - sNaq - 27.03.2013

this won't work
Код:
SetTimer("vitals",1000,1);
because you didnt specify what playerid is
Код:
public vitals(playerid)



Re: Simple Health Textdraw by S4ba - Riddick94 - 03.04.2013

Quote:
Originally Posted by S4ba
Посмотреть сообщение
it works also with OnGameModeInit()

lol

try it!
If you're gonna use OnGameModeInit instead of OnFilterScriptInit and someone gonna add your FS to filterscripts folder, then you're gonna fuck up his gamemode. Because there gonna be two OnGameModeInits. And probably rcon command for reloadfs not gonna work, but I am not sure about that. So, that's true, you should change it to FilterScriptInit, there must be a reason why we have GameMode and FilterScript, right?