Raised This Month: $32 Target: $400
 8% 

Win 5 ammopacks to destroy LaserMines


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
felipemilralze
Senior Member
Join Date: Jul 2011
Location: Brazil
Old 08-06-2015 , 13:30   Win 5 ammopacks to destroy LaserMines
Reply With Quote #1

It does not work.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <zp50_core>
#include <zp50_ammopacks>

public plugin_init()
{
    
RegisterHam(Ham_Killed"func_wall""fw_PlayerKilled"1);
}

public 
fw_PlayerKilled(victimattackershouldgib)
{     
    new 
sz_classname[32], Floathealth 
    entity_get_string
victim EV_SZ_classname sz_classnamecharsmax(sz_classname))

    
health entity_get_float(victimEV_FL_health)
  
    if(
equal(sz_classname"lasermine") && is_valid_ent(victim) && zp_core_is_zombie(attacker) && health <= 0.0)
    {
        new 
nome[33];
    
get_user_name(attackernome31);
    
zp_ammopacks_set(attackerzp_ammopacks_get(attacker) + 5)
    
ChatColor(0"!g[ZP]!y The player !g%s!y won !g5!y Ammopacks by destroying                LaserMines!"nome
    return 
HAM_IGNORED;
    }

    return 
HAM_IGNORED;


stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)

    
replace_all(msg190"!g""^4"// Cor Verde
    
replace_all(msg190"!y""^1"// Cor Normal
    
replace_all(msg190"!t""^3"// Cor do Time [TR = Vermelho] [CT = Azul] [SPECT = Branco]
    
replace_all(msg190"!t2""^0"// Cor do Time [TR = Vermelho] [CT = Azul] [SPECT = Branco]

    
if (idplayers[0] = id; else get_players(playerscount"ch")

    for (new 
0counti++)
    {
        if (
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
            
write_byte(players[i])
            
write_string(msg)
            
message_end()
        }
    }

felipemilralze is offline
Send a message via MSN to felipemilralze Send a message via Skype™ to felipemilralze
amir saiaoud
Senior Member
Join Date: May 2015
Location: essaouira , maroc
Old 08-06-2015 , 14:32   Re: Win 5 ammopacks to destroy LaserMines
Reply With Quote #2

why ?
__________________
amir saiaoud is offline
Send a message via Skype™ to amir saiaoud
felipemilralze
Senior Member
Join Date: Jul 2011
Location: Brazil
Old 08-07-2015 , 18:25   Re: Win 5 ammopacks to destroy LaserMines
Reply With Quote #3

No work
felipemilralze is offline
Send a message via MSN to felipemilralze Send a message via Skype™ to felipemilralze
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 08-08-2015 , 19:42   Re: Win 5 ammopacks to destroy LaserMines
Reply With Quote #4

PHP Code:
RegisterHam(Ham_Killed"func_wall""fw_PlayerKilled"1); 

PHP Code:
RegisterHam(Ham_TakeDamage"func_breakable""fw_TakeDamage"
Krtola is offline
Send a message via Skype™ to Krtola
Mint
New Member
Join Date: Jun 2015
Old 08-09-2015 , 02:52   Re: Win 5 ammopacks to destroy LaserMines
Reply With Quote #5

...

Last edited by Mint; 02-10-2021 at 06:03. Reason: .
Mint is offline
felipemilralze
Senior Member
Join Date: Jul 2011
Location: Brazil
Old 11-01-2015 , 19:50   Re: Win 5 ammopacks to destroy LaserMines
Reply With Quote #6

no work
felipemilralze is offline
Send a message via MSN to felipemilralze Send a message via Skype™ to felipemilralze
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 11-02-2015 , 11:15   Re: Win 5 ammopacks to destroy LaserMines
Reply With Quote #7

Try this:

Code:
#include <amxmodx> #include <hamsandwich> #include <engine> #include <zp50_core> #include <zp50_ammopacks> public plugin_init() {     RegisterHam(Ham_Killed, "func_breakable", "fwHamKilledBreakablePost", 1); } public fwHamKilledBreakablePost(iVictim, iAttacker) {     static iMaxPlayers;         if (!iMaxPlayers)         iMaxPlayers = get_maxplayers();         if (!(1 <= iAttacker <= iMaxPlayers)     || !is_user_connected(iAttacker)     || !zp_core_is_zombie(iAttacker))         return;         static szTempString[32];     entity_get_string(iVictim, EV_SZ_classname, szTempString, charsmax(szTempString))         if(!equali(szTempString, "lasermine"))         return;         zp_ammopacks_set(iAttacker, zp_ammopacks_get(iAttacker) + 5)         get_user_name(iAttacker, szTempString, charsmax(szTempString))         colored_chat(_, _, "Player^4 %s^1 won^4 5^1 Ammopacks by destroying LaserMines!", szTempString) } stock colored_chat(const iTarget = 0, const iSender = 0, const szMessage[], any:...) {     if (iTarget && !is_user_connected(iTarget))         return;         static szBuffer[192];     vformat(szBuffer, 191, szMessage, 4)         new const D7_CHAT_TAG[] = "^1[^4ZP^1] ";         format(szBuffer, 191, "%s%s", D7_CHAT_TAG, szBuffer)         static msgSayText;         if (!msgSayText)         msgSayText = get_user_msgid("SayText");         if (iTarget)         message_begin(MSG_ONE, msgSayText, _, iTarget)     else         message_begin(MSG_ALL, msgSayText)         write_byte(iSender ? iSender : iTarget)     write_string(szBuffer)     message_end() }
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
felipemilralze
Senior Member
Join Date: Jul 2011
Location: Brazil
Old 11-02-2015 , 12:23   Re: Win 5 ammopacks to destroy LaserMines
Reply With Quote #8

no work
felipemilralze is offline
Send a message via MSN to felipemilralze Send a message via Skype™ to felipemilralze
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 11-02-2015 , 12:42   Re: Win 5 ammopacks to destroy LaserMines
Reply With Quote #9

Quote:
Originally Posted by felipemilralze View Post
no work
You do realize that you only get the reward when you destroy a lasermine as a zombie, right?
Quote:
Originally Posted by georgik57 View Post
Code:
    if (!zp_core_is_zombie(iAttacker))         return;
PS: Post your lasermines plugin.
__________________

Last edited by georgik57; 11-02-2015 at 12:43.
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
felipemilralze
Senior Member
Join Date: Jul 2011
Location: Brazil
Old 11-02-2015 , 12:57   Re: Win 5 ammopacks to destroy LaserMines
Reply With Quote #10

Quote:
Yes

Last edited by felipemilralze; 11-02-2015 at 13:01.
felipemilralze is offline
Send a message via MSN to felipemilralze Send a message via Skype™ to felipemilralze
Reply



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

Forum Jump


All times are GMT -4. The time now is 21:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode