18.01.2019, 03:32
So I have this code:
So basically this will send the player who shot someone a message who he shot, while admins get a message Who shot who and with that gun. However, everytime a bullet hit it just spams the message, if you shot like 10 combat shotgun shots it'll send 10 messages which would spam. I wanted to make it when he shot this "player2" he'll get a message that he shot "player2" but it won't give another message if he shot the "player2" again with the same weapon, he'll get another message when he shot that "player2" with a different weapon. How do I do that?
PHP код:
if(playerid != INVALID_PLAYER_ID)
{
new string[129], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
new weaponname[24];
new adminstring[144];
GetPlayerName(playerid, attacker, sizeof (attacker));
GetPlayerName(damagedid, victim, sizeof (victim));
GetWeaponName(weaponid, weaponname, sizeof (weaponname));
format(string, sizeof(string), "You have shot %s with a weapon: %s", victim, weaponname);
SendClientMessage(playerid, -1, string);
format(adminstring, sizeof(adminstring), "* "COL_LIGHTGREEN"[DamageInfo] %s has shot %s with a weapon: %s", attacker, victim, weaponname);
SendMessageToAllAdmins(adminstring, -1);
format(adminstring, sizeof(adminstring), "\x0206[DamageInfo]\x02 \x1D%s has shot %s with a weapon: %s\x1D", attacker, victim, weaponname);
IRC_GroupSay(gGroupID, IRC_ADMINCHANNEL, adminstring);
}