Problem actor damage sendcilentmessagetoall
#1

I have problem with this script sends messages to all, I want to just send the player to harm the actor

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamageActor

Код:
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart)
{
    new string[128], attacker[MAX_PLAYER_NAME];
    new weaponname[24];
    GetPlayerName(playerid, attacker, sizeof (attacker));
    GetWeaponName(weaponid, weaponname, sizeof (weaponname));
 
    format(string, sizeof(string), "%s has made %.0f damage to actor id %d, weapon: %s", attacker, amount, damaged_actorid, weaponname);
    SendClientMessageToAll(0xFFFFFFFF, string);
    return 1;
}
This line Gives messages to everyone and chat
SendClientMessageToAll(0xFFFFFFFF, string);
Reply
#2

If you want to change to announce to the player who gave the actor damage, replace:
pawn Код:
SendClientMessageToAll(0xFFFFFFFF, string);
with:
pawn Код:
SendClientMessage(playerid, 0xFFFFFFFF, string);
as playerid (as stated in the callback) refers to the player who has given damage.
Reply
#3

Perhaps you should look up the meaning of the word "all" in a dictionary? The script is doing exactly what you're telling it to do.
Reply
#4

Quote:
Originally Posted by Dirki
Посмотреть сообщение
If you want to change to announce to the player who gave the actor damage, replace:
pawn Код:
SendClientMessageToAll(0xFFFFFFFF, string);
with:
pawn Код:
SendClientMessage(playerid, 0xFFFFFFFF, string);
as playerid (as stated in the callback) refers to the player who has given damage.
Thanks i was doing wrong the code is now okay.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)