Raised This Month: $51 Target: $400
 12% 

[Req] Pray Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shockyboy
Senior Member
Join Date: Apr 2014
Location: Earth
Old 02-14-2016 , 05:37   [Req] Pray Plugin
Reply With Quote #1

I need a pray plugin from which teammates, can save their teammates by praying for them, Max 20 hp to be received for we prayed. I.e [AMXX] Player %s Prayed for %s received 20HP.
__________________


[ LEARNING SCRIPTING ]
[ ||||||||||||] [ 30% ]
Shockyboy is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 02-14-2016 , 10:32   Re: [Req] Pray Plugin
Reply With Quote #2

how would a player pray for someone? ( Menu / USE Key )?
EpicMonkey is offline
Shockyboy
Senior Member
Join Date: Apr 2014
Location: Earth
Old 02-14-2016 , 10:43   Re: [Req] Pray Plugin
Reply With Quote #3

Quote:
Originally Posted by EpicMonkey View Post
how would a player pray for someone? ( Menu / USE Key )?
/pray
__________________


[ LEARNING SCRIPTING ]
[ ||||||||||||] [ 30% ]
Shockyboy is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 02-14-2016 , 10:49   Re: [Req] Pray Plugin
Reply With Quote #4

and what should /pray do?

Quote:
Originally Posted by EpicMonkey View Post
how would a player pray for someone? ( Menu / USE Key )?
EpicMonkey is offline
Shockyboy
Senior Member
Join Date: Apr 2014
Location: Earth
Old 02-15-2016 , 03:30   Re: [Req] Pray Plugin
Reply With Quote #5

Quote:
Originally Posted by EpicMonkey View Post
and what should /pray do?
/pray will give hp to whom you prayed and you can only pray once in round.
__________________


[ LEARNING SCRIPTING ]
[ ||||||||||||] [ 30% ]
Shockyboy is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 02-15-2016 , 14:14   Re: [Req] Pray Plugin
Reply With Quote #6

Try this

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN "Pray"
#define VERSION "1.0"
#define AUTHOR "None"

new bool:g_Healed33 ];

new 
cvar_PrayHealth;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd"say /pray""Pray" )
    
    
cvar_PrayHealth register_cvar"Prayer Health""20" )
    
    
register_logevent"logevent_round_start"2"1=Round_Start" )
}

public 
client_connectid //To avoid any issues
{
    
g_Healedid ] = false 
}

public 
client_disconnectid )
{
    
g_Healedid ] = false
}

public 
logevent_round_start()
{
    
arraysetg_Healedfalsecharsmaxg_Healed ) )
}

public 
Prayid )
{
    
// Remove nests/tags to disable praying while being dead
    /*if( !is_user_alive( id ) )
    {
        client_print( id, print_chat, "[AMXX] You need to be alive to pray" )
        return PLUGIN_HANDLED;
    }*/
    
if( g_Healedid ] )
    {
        
client_printidprint_chat"[AMXX] You've already prayed for a player this round" )
        return 
PLUGIN_HANDLED;
    }
    
    new 
menuiPlayers32 ], Name33 ], Tempid10 ], pNum;
    
    
menu menu_create("Pray for which player?""Menu_Handler")
    
    switch( 
cs_get_user_teamid ) )
    {
        case 
CS_TEAM_CTget_playersiPlayerspNum"ae""CT" )
        case 
CS_TEAM_Tget_playersiPlayerspNum"ae""TERRORIST" )
    }
    
    for( new 
0pNumi++ )
    {
        if( 
iPlayers] != id )
        {
            
get_user_nameiPlayers], NamecharsmaxName ) )
            
num_to_striPlayers], TempidcharsmaxTempid ) )
            
            
menu_additemmenuNameTempid0);
        }
    }
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL )
    
menu_displayidmenu);
    
    return 
PLUGIN_CONTINUE;
}

public 
Menu_Handleridmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ], Name133 ], Name233 ];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdata,5iNamecharsmaxiName ), callback );
    
    new 
Tempid str_to_numdata );
    
    
// Remove nests to disable praying while being dead
    /*if( !is_user_alive( id || Tempid ) )
    {
        client_print( id, print_chat, "[AMXX] Either you or the player selected are no longer alive" )
        return PLUGIN_HANDLED;
    }*/
    
if( !is_user_aliveTempid ) )
    {
        
client_printidprint_chat"[AMXX] The selected player is no longer alive" )
        return 
PLUGIN_HANDLED;
    }
    
    
g_Healedid ] = true
    
    get_user_name
idName1charsmaxName1 ) )
    
get_user_nameTempidName2charsmaxName2 ) )
    
    
set_user_healthTempidget_user_healthTempid ) + get_pcvar_numcvar_PrayHealth ) )
    
    
client_print0print_chat"[AMXX] Player %s prayed for %s and received [%dHP]"Name1Name2get_pcvar_numcvar_PrayHealth ) )
    
    return 
PLUGIN_HANDLED;


Last edited by EpicMonkey; 02-15-2016 at 14:15.
EpicMonkey is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 02-16-2016 , 07:34   Re: [Req] Pray Plugin
Reply With Quote #7

What a shitty plugin idea wtf.. xD it makes no sense to me
Syturi0 is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 02-16-2016 , 09:58   Re: [Req] Pray Plugin
Reply With Quote #8

Quote:
Originally Posted by Syturi0 View Post
What a shitty plugin idea wtf.. xD it makes no sense to me
he wants people to pray and be religious
EpicMonkey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-16-2016 , 20:36   Re: [Req] Pray Plugin
Reply With Quote #9

This is also known as a "medic".
__________________
fysiks is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 02-17-2016 , 12:54   Re: [Req] Pray Plugin
Reply With Quote #10

This is an awesome idea, it is an aboriginal medic plugin.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
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 14:18.


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