Duda con mensaje en OnPlayerGiveDamage
#1

Hola, tengo una duda tengo este codigo en OnPlayerGiveDamage:

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(IsPlayerInRangeOfPoint(playerid, 30.0,1530.2347,-1673.7479,13.3828) || IsPlayerInRangeOfPoint(playerid, 30.0, 1194.1886,-1323.1812,13.3984) || IsPlayerInRangeOfPoint(playerid, 30.0, -529.9733,-513.6573,35.4413))
{
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel] = 1);
        new zone[MAX_ZONE_NAME],string[250];
      GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
      SetPVarInt(playerid, "EMSAttempt", 1);
      SendClientMessageEx(playerid, COLOR_WHITE, "La SAPD lo ah descubierto atacando y ha sido informado de su ubicaciуn actual y estбn en camino.");
        format(string, sizeof(string), "* Central: Reportan a (%d) %s que ataca a diversas personas en %s.",playerid, GetPlayerNameEx(playerid), zone);
      SendRadioMessage(1, TEAM_RADIO_COLOR, string);
}
return 1;
}

Como ven, en el codigo hay un mensaje que llega a la SAPD cuando alguien golpea a otra persona, el problema es que si tu golpeas a cada rato a alguien te llega infinidades de mensajes a la radio de policia y hace mucho flood en la radio.

Alguien me podria decir como haria solo para que llege un mensaje ?
Reply
#2

Usa una variable que se resetee cierto tiempo usando un timer o una variable por jugador
Reply
#3

Intenta colocando:

public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(IsPlayerInRangeOfPoint(playerid, 30.0,1530.2347,-1673.7479,13.382 || IsPlayerInRangeOfPoint(playerid, 30.0, 1194.1886,-1323.1812,13.3984) || IsPlayerInRangeOfPoint(playerid, 30.0, -529.9733,-513.6573,35.4413))
{
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel] = 1);
new zone[MAX_ZONE_NAME],string[250];
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
SetPVarInt(playerid, "EMSAttempt", 1);
SendClientMessageEx(playerid, COLOR_WHITE, "La SAPD lo ah descubierto atacando y ha sido informado de su ubicaciуn actual y estбn en camino.");
format(string, sizeof(string), "* Central: Reportan a (%d) %s que ataca a diversas personas en %s.",playerid, GetPlayerNameEx(playerid), zone);
SendRadioMessage(1, TEAM_RADIO_COLOR, string);
return 1;
}
return 1;
}

y dime si te deja de aparecer a cada rato el mensaje o el flood aparece porq le da muchos golpes jaja si es asi proba lo q dice XSDx .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)