Textdraw question
#1

Ok i made a damage system, but instead of sendclientmessage of the amount of damage lost, i want to use a small textdraw that show for exmaple (-40 damage), but my problem is which function would i use to show the player that shoots and that take damage how much they lost.
Reply
#2

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
	new string[15];
	format(string, sizeof(string), "-%i damage.",amount);
	PlayerTextDrawSetString(playerid, "TEXTDRAW NAME", string);
	return 1;
}
This is pretty basic but you could build off of this. But you create the textdraw and use that to update the text. And then set a timer of some sort to hide the textdraw after a certain amount of time.
Reply
#3

^

playerid = player that took the damage
issuerid = player that inflicted the damage
Reply
#4

Quote:
Originally Posted by Blackboe
Посмотреть сообщение
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
	new string[15];
	format(string, sizeof(string), "-%i damage.",amount);
	PlayerTextDrawSetString(playerid, "TEXTDRAW NAME", string);
	return 1;
}
This is pretty basic but you could build off of this. But you create the textdraw and use that to update the text. And then set a timer of some sort to hide the textdraw after a certain amount of time.
pawn Код:
format(string,sizeof(string),"Damage: -%i ",floatround(Health+Armour));
        PlayerTextDrawSetString(Shooter, "dmg", string);
        format(string,sizeof(string),"Damage: -%i || Weapon: %s",floatround(Health+Armour),wep);
        PlayerTextDrawSetString(Target, "dmg", string);
That is my code but i get two errors.

pawn Код:
C:\Users\Andre'\Desktop\Andre'\samp\gamemodes\lsgw.pwn(6590) : error 035: argument type mismatch (argument 2)
C:\Users\Andre'\Desktop\Andre'\samp\gamemodes\lsgw.pwn(6592) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

bump
Reply
#6

Код:
  format(string,sizeof(string),"Damage: -%i ",floatround(Health+Armour));
		PlayerTextDrawSetString(Shooter, dmg, string);
	    format(string,sizeof(string),"Damage: -%i || Weapon: %s",floatround(Health+Armour),wep);
  		PlayerTextDrawSetString(Target, dmg, string);
Reply
#7

PlayerTextDrawSetString(Target, "dmg", string); replace PlayerTextDrawSetString(Target, your text, no "dmg", string);

use a new PlayerText:example[MAX_PLAYERS];

and add onplayerconnect
Reply
#8

I am still getting tag mismatch on the "PlayerTextDrawSetString" line and "dmg " is the name of the Textdraw
Reply
#9

show how you defined "dmg" textdraw
Reply
#10

pawn Код:
new Text:dmg;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)