//Put this under the includes
new PlayerText:Textdraw0[MAX_PLAYERS];
//Put this under OnPlayerConnect
Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 678.800048, 0.753333, "usebox");
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.000000, 49.458148);
PlayerTextDrawTextSize(playerid, Textdraw0[playerid], -5.199999, 0.000000);
PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw0[playerid], 0);
PlayerTextDrawUseBox(playerid, Textdraw0[playerid], true);
PlayerTextDrawBoxColor(playerid, Textdraw0[playerid], 102);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 0);
//Add this on the bottom of your script.
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
PlayerTextDrawShow(playerid,Textdraw0[playerid]);
SetTimerEx("DamageDrawHide",500,0,"i",playerid);
return 1;
}
forward DamageDrawHide(playerid);
public DamageDrawHide(playerid)
{
PlayerTextDrawHide(playerid,Textdraw0[playerid]);
}
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(386) : error 021: symbol already defined: "Textdraw0" C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(1064) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4067) : error 033: array must be indexed (variable "Textdraw0") C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4068) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4069) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4070) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4071) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4072) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4073) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4660) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4914) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(9533) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(15741) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(19591) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(23841) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(24310) : error 035: argument type mismatch (argument 1) C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(33467) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 17 Errors.
//Put this under the includes
new PlayerText:DamageTextDraw[MAX_PLAYERS];
//Put this under OnPlayerConnect
DamageTextDraw[playerid] = CreatePlayerTextDraw(playerid, 678.800048, 0.753333, "usebox");
PlayerTextDrawLetterSize(playerid, DamageTextDraw[playerid], 0.000000, 49.458148);
PlayerTextDrawTextSize(playerid, DamageTextDraw[playerid], -5.199999, 0.000000);
PlayerTextDrawAlignment(playerid, DamageTextDraw[playerid], 1);
PlayerTextDrawColor(playerid, DamageTextDraw[playerid], 0);
PlayerTextDrawUseBox(playerid, DamageTextDraw[playerid], true);
PlayerTextDrawBoxColor(playerid, DamageTextDraw[playerid], 102);
PlayerTextDrawSetShadow(playerid, DamageTextDraw[playerid], 0);
PlayerTextDrawSetOutline(playerid, DamageTextDraw[playerid], 0);
PlayerTextDrawFont(playerid, DamageTextDraw[playerid], 0);
//Add this on the bottom of your script.
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
PlayerTextDrawShow(playerid,DamageTextDraw[playerid]);
SetTimerEx("DamageDrawHide",500,0,"i",playerid);
return 1;
}
forward DamageDrawHide(playerid);
public DamageDrawHide(playerid)
{
PlayerTextDrawHide(playerid,DamageTextDraw[playerid]);
}
Is it possible too if you fall from a building or someone attacks you with a fist that your HP will not be less? Only by shots or bats or w/e?
|
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid == INVALID_PLAYER_ID)//So this is incase the player that gave you damage is not connected, which means collision ect
{
new Float:HP;//We will use this Float variable to store the player's HP
GetPlayerHealth(playerid, HP);//This will store the player's HP
SetPlayerHealth(playerid,HP + amount);//We'll set the player's Health to the original one by adding the After damage health + the amount of damage
}
return 1;
}