[FilterScript] Simple Health Textdraw by S4ba
#1

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);
}
Reply
#2

Nice
Reply
#3

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
Reply
#4

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?
Reply
#5

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
Reply
#6

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!
Reply
#7

simple but good
Reply
#8

yeah, thx
Reply
#9

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)