Help me Playerid
#1

How does the player hurt the line / damages% d it shows the player ID, if anyone knows how to help me.

Image:https://uphinhnhanh.com/image/1qvJjC

Code :
Quote:

new Float:health;
new string[128];
GetPlayerHealth(i,health);
SetPlayerHealth(i, health-1);
if(GetPVarInt(i, "EMSAttempt") == -1)
{
if(GetPlayerAnimationIndex(i) != 746) ClearAnimations(i), ApplyAnimation(i, "WUZI", "CS_Dead_Guy", 4.0, 0, 1, 1, 1, 0, 1);
if(!GetPVarType(i, "StreamPrep") && !IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")) && !GetPVarInt(i, "OnStretcher"))
{
SendClientMessageEx(i, COLOR_WHITE, "Ban da bi bat tinh, ban se duoc dua ve benh vien de dieu tri.");
KillEMSQueue(i);
SpawnPlayer(i);
}
format(string, sizeof(string), "(( Ban dang bi thuong, /damages %d de biet them thong tin. ))");
SetPlayerChatBubble(i,string,COLOR_LIGHTRED,50.0,1 0000);
GameTextForPlayer(i, "~r~BAN DANG BI THUONG", 5000, 3);
ApplyAnimation(i, "WUZI", "CS_Dead_Guy", 4.0, 0, 1, 1, 1, 0, 1);
}

Reply
#2

Код:
format(string, sizeof(string), "(( Ban dang bi thuong, /damages %d de biet them thong tin. ))");
In this line you format the string but forget to insert anything inside of the %d placeholder.

Код:
format(string, sizeof(string), "(( Ban dang bi thuong, /damages %d de biet them thong tin. ))", i);
This will insert the id of player i.



More info: https://sampforum.blast.hk/showthread.php?tid=265433
Reply
#3

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)