Raised This Month: $ Target: $400
 0% 

Is it possible to force client to sleep.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 07-31-2009 , 12:11   Is it possible to force client to sleep.
Reply With Quote #1

Is it possible to force client to sleep.
Like someone walk into the trap that i plant on the floor.

When he step on the trap he will be fade to black + can't move after few second return to normal ?
__________________
ƒa†es™ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-31-2009 , 12:42   Re: Is it possible to force client to sleep.
Reply With Quote #2

Yes it's possible.
__________________
Arkshine is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-31-2009 , 14:27   Re: Is it possible to force client to sleep.
Reply With Quote #3

This maybe can help you to freeze a player:

http://forums.alliedmods.net/showthread.php?t=81608
http://forums.alliedmods.net/showthread.php?t=29450

This maybe can help you to get origins to do the trap:

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN    "Get angles & origin"
#define AUTHOR    "Alucard"
#define VERSION    "2.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /origin""get_origin")
    
register_clcmd("say /angles""get_angles")
    
register_clcmd("say /vangles""get_vangles")
    
register_clcmd("say /getmenu""get_menu")
}

public 
get_menu(id)
{
    new 
menu menu_create("\yGet Menu:""get_show")
    
    
menu_additem(menu"\wOrigin""1"0)
    
menu_additem(menu"\wAngles""2"0)
    
menu_additem(menu"\wV Angles""3"0)
    
    
menu_setprop(menu,MPROP_EXITNAME,"Salir")
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
    
menu_display(idmenu0
    return 
PLUGIN_HANDLED
}

public 
get_show(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
iData[6]
    new 
iAccess
    
new iCallback
    
new iName[64]
    
    
menu_item_getinfo(menuitemiAccessiData5iName63iCallback)
    
    switch(
str_to_num(iData))
    {
        case 
1:
        {
            
get_origin(id)
            
menu_display(idmenu0)
        }
        case 
2:
        {
            
get_angles(id)
            
menu_display(idmenu0)
        }
        case 
3:
        {
            
get_vangles(id)
            
menu_display(idmenu0)
        }
    }
    return 
PLUGIN_HANDLED
}

public 
get_origin(id)
{
    new 
Float:fOrigin[3]
    
pev(id pev_origin fOrigin)
    
client_print(idprint_chat"origin: %f, %f, %f"fOrigin[0], fOrigin[1], fOrigin[2])
    return 
PLUGIN_HANDLED
}

public 
get_angles(id)
{
    new 
Float:fAngles[3]
    
pev(id pev_angles fAngles)
    
client_print(idprint_chat"angles: %f, %f, %f"fAngles[0], fAngles[1], fAngles[2])
    return 
PLUGIN_HANDLED
}

public 
get_vangles(id)
{
    new 
Float:fVAngles[3]
    
pev(id pev_v_angle fVAngles)
    
client_print(idprint_chat"v_angles: %f, %f, %f"fVAngles[0], fVAngles[1], fVAngles[2])
    return 
PLUGIN_HANDLED

And this maybe can help you to do a fade to black:

PHP Code:
stock Fade(id,red,green,blue,alpha)
{
    
message_begin(MSG_ONE,g_fade,{0,0,0},id)
    
write_short(1<<10)
    
write_short(1<<10)
    
write_short(1<<12)
    
write_byte(red)
    
write_byte(green)
    
write_byte(blue)
    
write_byte(alpha)
    
message_end()

__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 07-31-2009 , 21:59   Re: Is it possible to force client to sleep.
Reply With Quote #4

How do i make a plugin that can plant a trap when a person step into my trap he will fade to black + can't move for some second ?

After seeing your codes i still don't understand.
__________________
ƒa†es™ is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-31-2009 , 23:10   Re: Is it possible to force client to sleep.
Reply With Quote #5

Quote:
Originally Posted by ƒa†es™ View Post
How do i make a plugin that can plant a trap when a person step into my trap he will fade to black + can't move for some second ?

After seeing your codes i still don't understand.
What you dont understand?

About the Get angles & origin utilitie... you dont have to understand the code.. use the plugin to get the origin of a position in a map (/getmenu) and then you can set the origin to the trap, but to do the trap you have to create an entity (i think), and if you dont understand this code you cant do a "trap" cuz that is more advanced... maybe try to see the code in blockmaker plugins.

About screenfade, well.. here an example:

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "Fade Example"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

new g_fade

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_fade get_user_msgid("ScreenFade")
    
    
register_clcmd("say /fademe""FadeHandler")
}

public 
FadeHandler(id)
{
    
Fade(id,255,0,0,20)
}

stock Fade(id,red,green,blue,alpha)
{
    
message_begin(MSG_ONE,g_fade,{0,0,0},id)
    
write_short(1<<10)
    
write_short(1<<10)
    
write_short(1<<12)
    
write_byte(red)
    
write_byte(green)
    
write_byte(blue)
    
write_byte(alpha)
    
message_end()

I know this plugin work but maybe should be:

PHP Code:
public FadeHandler(id)
{
    
message_begin(MSG_ONE,g_fade,{0,0,0},id)
    
write_short(1<<10)
    
write_short(1<<10)
    
write_short(1<<12)
    
write_byte(255//red
    
write_byte(0//green
    
write_byte(0//blue
    
write_byte(20//alpha
    
message_end()

But i am not sure if using the stock is better or not.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 08-01-2009 , 00:09   Re: Is it possible to force client to sleep.
Reply With Quote #6

You can check if the player touchs that "trap" (Ham_Touch?!) and then make him "sleep"
__________________
IneedHelp 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 18:26.


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