13.11.2014, 16:26
pawn Код:
#include <a_samp>
new WeaponNames[55][] =
{
{"Punch"},{"Brass Knuckles"},{"Golf Club"},{"Nite Stick"},{"Knife"},{"Baseball Bat"},{"Shovel"},{"Pool Cue"},{"Katana"},{"Chainsaw"},{"Purple Dildo"},
{"Smal White Vibrator"},{"Large White Vibrator"},{"Silver Vibrator"},{"Flowers"},{"Cane"},{"Grenade"},{"Tear Gas"},{"Molotov Cocktail"},
{""},{""},{""}, // Empty spots for ID 19-20-21 (invalid weapon id's)
{"Colt"},{"Silenced 9mm"},{"Deagle"},{"Shotgun"},{"Sawn-off"},{"Combat"},{"Micro SMG"},{"MP5"},{"AK-47"},{"M4"},{"Tec9"},
{"Rifle"},{"Sniper"},{"Rocket"},{"HS Rocket"},{"Flamethrower"},{"Minigun"},{"Satchel Charge"},{"Detonator"},
{"Spraycan"},{"Fire Extinguisher"},{"Camera"},{"Nightvision Goggles"},{"Thermal Goggles"},{"Parachute"}, {"Fake Pistol"},{""}, {"Vehicle"}, {"Helicopter Blades"},
{"Explosion"}, {""}, {"Drowned"}, {"Collision"}
};
new Text:danos[MAX_PLAYERS];
new Text:danos2[MAX_PLAYERS];
new TempoMostrarLife[MAX_PLAYERS];
new MostrandoVida[MAX_PLAYERS];
new TempoMostrarLife2[MAX_PLAYERS];
new MostrandoVida2[MAX_PLAYERS];
stock PlayerName(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
return Name;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" TEXTDRAW DAMAGE FEITO POR DOKyPWN");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
for(new i; i < GetMaxPlayers(); i++)
{
danos[i] = TextDrawCreate(202.00000, 370.00000, " ");
TextDrawFont(danos[i], 1);
TextDrawColor(danos[i], 16727295);
TextDrawSetOutline(danos[i], 1);
TextDrawSetProportional(danos[i], 1);
TextDrawLetterSize(danos[i], 0.200000, 1.000000);
TextDrawAlignment(danos[i], 2 );
TextDrawSetShadow(danos[i], 0 );
danos2[i] = TextDrawCreate(440.00000, 370.00000, " ");
TextDrawFont(danos2[i], 1);
TextDrawColor(danos2[i], 0x00FFB0FF);
TextDrawSetOutline(danos2[i], 1);
TextDrawSetProportional(danos2[i], 1);
TextDrawLetterSize(danos2[i], 0.200000, 1.000000);
TextDrawAlignment(danos2[i], 2 );
TextDrawSetShadow(danos2[i], 0 );
}}
public OnPlayerDisconnect(playerid, reason)
{
TextDrawDestroy(danos[playerid]);
TextDrawDestroy(danos2[playerid]);
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if (issuerid != INVALID_PLAYER_ID)
{
new str[1500];
KillTimer(TempoMostrarLife2[playerid]);
TextDrawShowForPlayer(playerid, danos2[playerid]);
format(str,sizeof(str),"~r~~H~%s ~w~-%.2f ~r~~H~(%s) / ~w~(%.0f)", PlayerName(issuerid), amount, WeaponNames[weaponid]);
TextDrawSetString(danos2[playerid], str);
TempoMostrarLife2[playerid] = SetTimerEx("HideTextoLife2", 3000, 0, "i", playerid);
MostrandoVida2[playerid] = 1;
KillTimer(TempoMostrarLife[issuerid]);
TextDrawShowForPlayer(issuerid, danos[issuerid]);
format(str,sizeof(str),"~g~~h~~h~%s ~w~-%.2f ~g~~h~~h~(%s) / ~w~(%.0f)", PlayerName(playerid), amount, WeaponNames[weaponid]);
TextDrawSetString(danos[issuerid], str);
TempoMostrarLife[issuerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", issuerid);
MostrandoVida[issuerid] = 1;
PlayerPlaySound(issuerid , 17802, 0.0, 0.0, 0.0);
}
return 1;
}
forward HideTextoLife(playerid);
public HideTextoLife(playerid)
{
if(MostrandoVida[playerid] == 1)
{
TextDrawHideForPlayer(playerid, danos[playerid]);
MostrandoVida[playerid] = 0;
}
return 1;
}
forward HideTextoLife2(playerid);
public HideTextoLife2(playerid)
{
if(MostrandoVida2[playerid] == 1)
{
TextDrawHideForPlayer(playerid, danos2[playerid]);
MostrandoVida2[playerid] = 0;
}
return 1;
}
}