Quote:
Originally Posted by tamirshoval
yes,it means if the player is a cop.
But if i will use SendClientMessage They wont see the attacker name and deatils right?
So is that posibole for telling them the loaction (Like,Idlewood)?
|
SendClientMessage would be like
"SendClientMessage(attackerName, COLOR, string);" or "SendClientMessage(victimName, COLOR, string);"(Those were just examples)
So either the attacker or the victim would see it.
Do you have a stock or a callback, or anything, that allows cops to have a "Special" chat, or anything that sends a message only to cops?
About the location - I'm personally not that good, but it is possible..
I don't know how to create it, but either it's with "IsPlayerInRangeIfPoint", or something else, not sure :\
And about that "Police[playerid] == 2"
But what do you want to do with the Police[playerid] afterwards?
Do you want it, so the cops get that message only if a cop is being attacked?
If you want that, then you would need to do this i guess -
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
{
new
infoString[128],
weaponName[24],
victimName[MAX_PLAYER_NAME],
attackerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, victimName, sizeof (victimName));
GetPlayerName(issuerid, attackerName, sizeof (attackerName));
if(Police[playerid] == 2)//If the victim is a cop
{
format(infoString, sizeof(infoString), "[DISPATCH] - %s has attacked %s | weapon: %s | damage: %.0f |", attackerName, victimName, weaponName, amount);//This message is being formated
//Command that will send the message to the cops, for an ex: SendMessageToCops, or w.e you have!
SetPlayerWantedLevel(issuerid, GetPlayerWantedLevel(issuerid) +1);//This will set the players(attackers, issuers) wanted level to +1, when he has attacked somebody
}
}
return 1;
}
It's getting kinda late, so sorry, but i need to go off, try calling somebody else like "Danishaq, Konstantinos or Wizzy", well, those are the people who i trust the most :d