[Ajuda] Dano ao Player - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Dano ao Player (
/showthread.php?tid=466596)
Dano ao Player -
powerths - 28.09.2013
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(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID) // If not self-inflicted
{
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);
}
return 1;
}
Re: Dano ao Player -
Locky_ - 28.09.2013
Vocк tб dizendo que б mensagem tб se repitindo muito rбpido, e que ela sу seja ativa em 30 segundos? '-' Nгo entendi direito .-.
Re: Dano ao Player -
powerths - 28.09.2013
Sim mensagem repete varias vezes to querendo colocar no intervalo de 30 segundos
Re: Dano ao Player -
powerths - 28.09.2013
Alguem
Re: Dano ao Player -
Locky_ - 28.09.2013
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