

filterscripts DHA


// /$$$$$$$$ /$$ /$$ /$$$$$$$$
// | $$_____/ |__/| $$ |_____ $$
// | $$ /$$$$$$ /$$| $$ /$$$$$$ /$$$$$$ /$$/
// | $$$$$ |____ $$| $$| $$ /$$__ $$ /$$__ $$ /$$/
// | $$__/ /$$$$$$$| $$| $$| $$$$$$$$| $$ \__/ /$$/
// | $$ /$$__ $$| $$| $$| $$_____/| $$ /$$/
// | $$ | $$$$$$$| $$| $$| $$$$$$$| $$ /$$$$$$$$
// |__/ \_______/|__/|__/ \_______/|__/ |________/
/*******************************************************************************
* Digital Health & Armour [DHA] - by FailerZ *
* Copyright © *
*******************************************************************************/
|
C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(106) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(122) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(12 : warning 217: loose indentationC:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(132) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(187) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(196) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(230) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(231) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(274) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(275) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 10 Warnings. |
|
I've tried to do it trought pastbin, and it gives me some warns
Code:
C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(106) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(122) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(12 : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(132) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(187) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(196) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(230) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(231) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(274) : warning 217: loose indentation C:\Documents and Settings\user\Desktop\R-RP\gamemodes\test.pwn(275) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 10 Warnings. |
#pragma tabsize 0
, Your code will work only for ID:0 when ID:1 connects the Textdraw will show ID:0's Health and Armour/*******************************************************************************
* Digital Health & Armour [DHA]- by FailerZ *
* Copyright © *
*******************************************************************************/
//================================ [Includes] ==================================
#include <a_samp> //Credits to Kalcor/Kye
//================================= [Variables] ===================================
new PlayerText:DigiHP[MAX_PLAYERS], PlayerText:DigiAP[MAX_PLAYERS];
//------------------------------------------------------------------------------
//CallBacks and Publics
public OnFilterScriptInit()
{
print("---------------------------------------");
print("| Digital Health & Armour by FailerZ |");
print("| Loaded |");
print("---------------------------------------");
return 1;
}
//------------------------------------------------------------------------------
public OnFilterScriptExit()
{
print("---------------------------------------");
print("| Digital Health & Armour by FailerZ |");
print("| Unloaded |");
print("---------------------------------------");
return 1;
}
//------------------------------------------------------------------------------
public OnPlayerConnect(playerid)
{
//HP Check
PlayerTextDrawShow(playerid, DigiHP[playerid]);
//AP Check
new Float:Armour;
GetPlayerArmour(playerid, Armour);
if(Armour >= 1)
return PlayerTextDrawShow(playerid, DigiAP[playerid]);
CreateDigitalHealthAndArmour(playerid);
return 1;
}
//------------------------------------------------------------------------------
public OnPlayerDisconnect(playerid, reason)
{
PlayerTextDrawHide(playerid, DigiHP[playerid]);
PlayerTextDrawHide(playerid, DigiAP[playerid]);
PlayerTextDrawDestroy(playerid, DigiHP[playerid]);
PlayerTextDrawDestroy(playerid, DigiAP[playerid]);
return 1;
}
//------------------------------------------------------------------------------
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
return OnArmourAndHealthUpdate(playerid), 1; // means return 1; or return true;
}
stock OnArmourAndHealthUpdate(playerid)
{
new Float:Health, Float:Armour, string[ 10 ];
GetPlayerHealth(playerid, Health), GetPlayerArmour(playerid, Armour);
//HP Check
format(string, sizeof(string), "%.0f", Health);
PlayerTextDrawSetString(playerid, DigiHP[playerid], string);
//AP Check
if(Armour >= 1)
{
format(string, sizeof(string), "%.0f", Armour);
PlayerTextDrawSetString(playerid, DigiAP[playerid], string);
}
else
{
PlayerTextDrawHide(playerid, DigiAP[playerid]);
}
return true;
}
stock CreateDigitalHealthAndArmour(playerid)
{
//HP Textdraw
DigiHP[playerid] = CreatePlayerTextDraw(playerid, 566.000000, 68.000000, "100");
PlayerTextDrawBackgroundColor(playerid, DigiHP[playerid], -1);
PlayerTextDrawFont(playerid, DigiHP[playerid], 1);
PlayerTextDrawLetterSize(playerid, DigiHP[playerid], 0.350000, 0.599999);
PlayerTextDrawColor(playerid, DigiHP[playerid], 255);
PlayerTextDrawSetOutline(playerid, DigiHP[playerid], 1);
PlayerTextDrawSetProportional(playerid, DigiHP[playerid], 1);
//AP Textdraw
DigiAP[playerid] = CreatePlayerTextDraw(playerid, 566.000000, 47.000000, "100");
PlayerTextDrawBackgroundColor(playerid, DigiAP[playerid], -1);
PlayerTextDrawFont(playerid, DigiAP[playerid], 1);
PlayerTextDrawLetterSize(playerid, DigiAP[playerid], 0.349999, 0.599999);
PlayerTextDrawColor(playerid, DigiAP[playerid], 255);
PlayerTextDrawSetOutline(playerid, DigiAP[playerid], 1);
PlayerTextDrawSetProportional(playerid, DigiAP[playerid], 1);
}

public OnPlayerUpdate(playerid)
{
//HP Check
new Float:Health, hstr[500];
GetPlayerHealth(playerid, Health);
format(hstr, sizeof(hstr), "%.0f", Health);
TextDrawSetString(DigiHP, hstr);
TextDrawShowForPlayer(playerid, DigiHP);
//AP Check
new Float:Armour, astr[500];
GetPlayerArmour(playerid, Armour);
if(Armour >= 1)
{
format(astr, sizeof(astr), "%.0f", Armour);
TextDrawSetString(DigiAP, astr);
TextDrawShowForPlayer(playerid, DigiAP);
}
else
{
TextDrawHideForPlayer(playerid, DigiAP);
}
return 1;
}
|
I have heard really bad stories about murders happen if you use too much stuff on OnPlayerUpdate. Kidding, but I've been reminded tons of times by the people I ask for help to almost never use OnPlayerUpdate. Instead they told me to use a timer. Anyways nice work! :P
|