[Ajuda] Dano ao Player
#1

Intгo to querendo fazer que o dano do player tenho um intervelo de 30 segundo para parece o proximo dano nele, Quando atiro no player ai aparece varias vezes esse dano to querendo colocar em 30 segundo.



PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponid)
{
if(
issuerid != INVALID_PLAYER_ID// If not self-inflicted
{
new
plid,
infoString[128],
weaponName[24],
victimName[MAX_PLAYER_NAME],
attackerName[MAX_PLAYER_NAME];
GetPlayerName(playeridvictimNamesizeof (victimName));
GetPlayerName(issueridattackerNamesizeof (attackerName));
GetWeaponName(weaponidweaponNamesizeof (weaponName));
format(infoStringsizeof(infoString), "» %s feriu %s com um(a) %s e rancou dele %.0f de vida. "attackerNamevictimNameweaponNameamount);
SendClientMessage(playerid,  brancoinfoString);
format(infoStringsizeof(infoString), "» %s feriu %s com um(a) %s e rancou dele %.0f de vida. "attackerNamevictimNameweaponNameamount);
SendClientMessage(plidbrancoinfoString);
}
return 
1;

Reply
#2

Vocк tб dizendo que б mensagem tб se repitindo muito rбpido, e que ela sу seja ativa em 30 segundos? '-' Nгo entendi direito .-.
Reply
#3

Sim mensagem repete varias vezes to querendo colocar no intervalo de 30 segundos
Reply
#4

Alguem
Reply
#5

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) {
    if(issuerid == INVALID_PLAYER_ID) return 1;
    if(GetPVarInt(playerid, "TakeDamageMsg") >= gettime()) return 1;
    new plid, infoString[128],weaponName[24], victimName[MAX_PLAYER_NAME], attackerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, victimName, sizeof (victimName));
    GetPlayerName(issuerid, attackerName, sizeof (attackerName));
    GetWeaponName(weaponid, weaponName, sizeof (weaponName));
    format(infoString, sizeof(infoString), "» %s feriu %s com um(a) %s e rancou dele %.0f de vida. ", attackerName, victimName, weaponName, amount);
    SendClientMessage(playerid,  branco, infoString);
    format(infoString, sizeof(infoString), "» %s feriu %s com um(a) %s e rancou dele %.0f de vida. ", attackerName, victimName, weaponName, amount);
    SendClientMessage(plid, branco, infoString);
    SetPVarInt(playerid, "TakeDamageMsg", (gettime() + 30));
    return 1;
}
Tente assim
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)