SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese > Lançamentos/Releases

Reply
 
Thread Tools Display Modes
Old 15/06/2012, 09:31 PM   #1
[MsT]Pho3niX
Little Clucker
 
Join Date: Apr 2012
Location: Mariana, Minas Gerais, Brazil
Posts: 45
Reputation: 3
Post GiveDamage and TakeDamage with TextDraw and Sound

Ae pessoal, criei essa FilterScript para GM's de A/D e DM

Fiquem a vontade para usa-lo! Ainda esta em versão BETA!


pawn Code:
#include <a_samp>

#define LGreenColor   0x00FF04FF
#define RedColor      0xE81010FF

new Text:GiveDamage[MAX_PLAYERS];
new Text:TakeDamage[MAX_PLAYERS];

public OnGameModeInit()
{
    for(new i; i < MAX_PLAYERS; ++i)
    {
    GiveDamage[i] = TextDrawCreate(171.000000, 388.000000, " ");
    TextDrawAlignment(GiveDamage[i], 2);
    TextDrawBackgroundColor(GiveDamage[i], 255);
    TextDrawFont(GiveDamage[i], 2);
    TextDrawLetterSize(GiveDamage[i], 0.160000, 0.599999);
    TextDrawColor(GiveDamage[i], 0x00FF04FF);
    TextDrawSetOutline(GiveDamage[i], 1);
    TextDrawSetProportional(GiveDamage[i], 1);
    }

    for(new i; i < MAX_PLAYERS; ++i)
    {
    TakeDamage[i] = TextDrawCreate(440.000000,388.000000, " ");
    TextDrawAlignment(TakeDamage[i], 2);
    TextDrawBackgroundColor(TakeDamage[i], 255);
    TextDrawFont(TakeDamage[i], 2);
    TextDrawLetterSize(TakeDamage[i], 0.160000, 0.599999);
    TextDrawColor(TakeDamage[i], 0xE81010FF);
    TextDrawSetOutline(TakeDamage[i], 1);
    TextDrawSetProportional(TakeDamage[i], 1);
    }
    return 1;
}

forward OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid);
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    new s[20];
    format(s, 20, "+Damage %.0f", amount);
    TextDrawSetString(GiveDamage[playerid], s);
    TextDrawShowForPlayer(playerid, GiveDamage[playerid]);
    PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
    return 1;
}

forward OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid);
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new s[20];
    format(s, 20, "-Damage %.0f", amount);
    TextDrawSetString(TakeDamage[playerid], s);
    TextDrawShowForPlayer(playerid, TakeDamage[playerid]);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
    return 1;
}

forward DestruirTextoDraw(playerid);
public DestruirTextoDraw(playerid)
{
    TextDrawHideForPlayer(playerid, GiveDamage[playerid]);
    TextDrawHideForPlayer(playerid, TakeDamage[playerid]);
    return 1;
}

Quando voce acertar um tiro ou um golpe, aparecerá o dano e emitirá um som de acerto.


Quando voce tomar um tiro,golpe ou sofre uma queda, aparecerá o dano.
http://img85.imageshack.us/img85/2588/samp028iwd.png
'

Last edited by [MsT]Pho3niX; 16/06/2012 at 02:34 AM.
[MsT]Pho3niX is offline   Reply With Quote
Old 15/06/2012, 09:49 PM   #2
Luciano*
Gangsta
 
Luciano*'s Avatar
 
Join Date: Jan 2012
Posts: 658
Reputation: 16
Default Respuesta: GiveDamage and TakeDamage with TextDraw and Sound

Print?
__________________


Luciano* is offline   Reply With Quote
Old 15/06/2012, 10:08 PM   #3
paulor
High-roller
 
Join Date: Nov 2011
Location: Brasil
Posts: 3,116
Reputation: 222
Default Re: GiveDamage and TakeDamage with TextDraw and Sound

Seria mais interessante se usa-se Label.
Obs: Não era necessário usar OnPlayerGiveDamage E OnPlayerTakeDamage, Com somente um deles vc ja faz isso!
__________________
Meus Projetos - contato@paulorwd.com.br
[IMG]https://sites.******.com/site/facesbypaulo/MetropoleGames.png[/IMG]
paulor is offline   Reply With Quote
Old 16/06/2012, 01:58 AM   #4
[MsT]Pho3niX
Little Clucker
 
Join Date: Apr 2012
Location: Mariana, Minas Gerais, Brazil
Posts: 45
Reputation: 3
Default Re: GiveDamage and TakeDamage with TextDraw and Sound

Quote:
Originally Posted by paulor View Post
Seria mais interessante se usa-se Label.
Obs: Não era necessário usar OnPlayerGiveDamage E OnPlayerTakeDamage, Com somente um deles vc ja faz isso!
Opa, obrigado pelas sugestões... Vou tentar melhorar amigo... xD
[MsT]Pho3niX is offline   Reply With Quote
Old 16/06/2012, 02:07 AM   #5
Kuddy
High-roller
 
Kuddy's Avatar
 
Join Date: Jun 2011
Location: Brasil / Paraná
Posts: 2,876
Reputation: 313
Default Re: GiveDamage and TakeDamage with TextDraw and Sound

Simples más útil.
__________________
"CRIANÇÃ GAMER OTAKO QUE SOFREU BULLYING NA ESCOLA E AINDA É BV"
Kuddy is offline   Reply With Quote
Old 16/06/2012, 02:33 AM   #6
[MsT]Pho3niX
Little Clucker
 
Join Date: Apr 2012
Location: Mariana, Minas Gerais, Brazil
Posts: 45
Reputation: 3
Default Re: GiveDamage and TakeDamage with TextDraw and Sound

Quote:
Originally Posted by Kuddy View Post
Simples más útil.
Sim. Obrigado!
[MsT]Pho3niX is offline   Reply With Quote
Old 16/06/2012, 02:35 AM   #7
[MsT]Pho3niX
Little Clucker
 
Join Date: Apr 2012
Location: Mariana, Minas Gerais, Brazil
Posts: 45
Reputation: 3
Default Re: Respuesta: GiveDamage and TakeDamage with TextDraw and Sound

Quote:
Originally Posted by Luciano* View Post
Print?
Quando voce acertar um tiro ou um golpe, aparecerá o dano e emitirá um som de acerto.


Quando voce tomar um tiro,golpe ou sofre uma queda, aparecerá o dano.
http://img85.imageshack.us/img85/2588/samp028iwd.png
'
[MsT]Pho3niX is offline   Reply With Quote
Old 16/06/2012, 02:46 AM   #8
Ades
Gangsta
 
Ades's Avatar
 
Join Date: May 2012
Location: Ji-Parana - RO ,Brazil
Posts: 781
Reputation: 63
Default Re: GiveDamage and TakeDamage with TextDraw and Sound

Aa entendi agora , graças ao Print '-'


Muito bom +rep
__________________
Projects :

[Map] Wrong way and the right way [||||||||||||||||||||]

[Map] [||||||||||||||||||||]



Ades is offline   Reply With Quote
Old 16/06/2012, 02:50 AM   #9
[MsT]Pho3niX
Little Clucker
 
Join Date: Apr 2012
Location: Mariana, Minas Gerais, Brazil
Posts: 45
Reputation: 3
Default Re: GiveDamage and TakeDamage with TextDraw and Sound

Quote:
Originally Posted by Ades View Post
Aa entendi agora , graças ao Print '-'


Muito bom +rep

Opa, obrigado aee parça xD
E procure saber, jogar Servers com GM de A/D... Procure mais sobre SB-CBS.
GTA:T também...
[MsT]Pho3niX is offline   Reply With Quote
Old 16/06/2012, 02:58 AM   #10
StrondA_
Gangsta
 
StrondA_'s Avatar
 
Join Date: Feb 2011
Posts: 894
Reputation: 12
Default Re: GiveDamage and TakeDamage with TextDraw and Sound

Quote:
Originally Posted by paulor View Post
Seria mais interessante se usa-se Label.
Obs: Não era necessário usar OnPlayerGiveDamage E OnPlayerTakeDamage, Com somente um deles vc ja faz isso!
não é porque ele deixou de fazer do modo que você disse que o código e funções do script deixa a desejar..

parabéns, bom trabalho, apenas algum errinho de endentação..

código simples e legal para servidores de death mach..
__________________
- which the logic programming without creativity?
StrondA_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] GiveDamage and TakeDamage with TextDraw and Sound [MsT]Pho3niX Filterscripts 26 13/12/2014 03:30 PM
OnPlayerGiveDamage / TakeDamage PrawkC Scripting Help 3 15/09/2012 07:24 AM
Looking for sound id... Audiophr3ak Scripting Help 4 13/04/2012 08:32 AM


All times are GMT. The time now is 07:05 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.