This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

set left/right hand


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tcPane
Senior Member
Join Date: Sep 2010
Old 08-16-2012 , 12:24   set left/right hand
Reply With Quote #1

Hello,
can u give me simple plugin which set left or right hand when round end?

Last edited by tcPane; 08-16-2012 at 12:24.
tcPane is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 08-16-2012 , 16:51   Re: set left/right hand
Reply With Quote #2

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

#define PLUGIN "Auto Hand switch"
#define VERSION "1.0"
#define AUTHOR "Khalid"

#define TASKID1        2000
#define TASKID2        2032

new Agreed[33] = 0

new gKeys = (MENU_KEY_0|MENU_KEY_1)

new 
right_hand 1

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("TeamInfo""eTeam_Join""b")
    
register_menucmd(register_menuid("This server requires to change weapon view model to right/left hand each round end!^nDo you agree?"), gKeys"menu_handler")
    
register_logevent("eRoundEnd"2"1=Round_End")
}

public 
eTeam_Join(id)
{
    
set_task(15.0"show_menu_to_user"id)
}

public 
show_menu_to_user(id)        // So it won't be slow hacking ...
{
    new 
menu[100]
    
formatex(menucharsmax(menu), "This server requires to change weapon view model to right/left hand each round end!^nDo you agree?^n1. Yes, I agree^n 2. No, I don't agree \r[You will be kicked]")
    
show_menu(idgKeysmenu15)
    
set_task(15.0"kick_user"TASKID1 id)        // Kick him if he didn't choose
    
return PLUGIN_CONTINUE
}

public 
kick_user(TASK)
{
    new 
id TASK TASKID1
    server_cmd
("kick #%d"get_user_userid(id))
    return 
PLUGIN_HANDLED
}

public 
client_disconnect(id)
{
    
Agreed[id] = 0
    
    
if(task_exists(id TASKID1))
        
remove_task(id TASKID1)
    
    if(
task_exists(id TASKID2))
        
remove_task(id TASKID2)
}

public 
menu_handler(idkey)
{
    if(
key == 0)
    {
        
Agreed[id] = 1
        set_task
(5.0"client_cvar"TASKID2 id,_,_"b")
    }
    
    else if(
key == 1)
        
server_cmd("kick #%d"get_user_userid(id))
}

public 
eRoundEnd()
{
    new 
players[32], countplayer
    
    get_players
(playerscount)
    for(new 
icounti++)
    {
        
player players[i]
        if(
right_hand == 1)
        {
            if(
Agreed[player] == 1)
                
client_cmd(player"cl_righthand 1")
            
right_hand 0
        
}
        
        else if(
right_hand == 0)
        {
            if(
Agreed[player] == 1)
                
client_cmd(player"cl_righthand 0")
            
right_hand 0
        
}
    }
}

public 
client_cvar(TASK2)
{
    new 
id TASK2 TASKID2
    query_client_cvar
(id"cl_righthand""client_cvar2")
}

public 
client_cvar2(idcvar[], value[])
{
    new 
numvalue str_to_num(value)
    
    if( 
right_hand != numvalue )
        
client_cmd(id"cl_righthand %d"numvalue)
    
    return 
PLUGIN_HANDLED

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 08-17-2012 at 20:44.
pokemonmaster is offline
tcPane
Senior Member
Join Date: Sep 2010
Old 08-17-2012 , 01:16   Re: set left/right hand
Reply With Quote #3

Thanks you, but I dont want this. Just I want when round end set player left/right hand and at new round back player default hand ( with the hand that was before plugin put set/right)
tcPane is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-17-2012 , 01:22   Re: set left/right hand
Reply With Quote #4

You have to ask players permission if you want to change such setting on their game.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
tcPane
Senior Member
Join Date: Sep 2010
Old 08-17-2012 , 06:11   Re: set left/right hand
Reply With Quote #5

Ok, can u make me this:

when player connect in the server shows this :

This server requires to change right/left hand when round end
1. Yes, I Agree ( if player choose this, when round end set right/left hand )
2. No, I Don't Agree ( if player choose this, kick him )
tcPane is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-17-2012 , 07:41   Re: set left/right hand
Reply With Quote #6

Quote:
Originally Posted by pokemonmaster View Post
Hmmmmmmmmmmmm?
That will kick everyone

Quote:
Originally Posted by tcPane View Post
Ok, can u make me this:

when player connect in the server shows this :

This server requires to change right/left hand when round end
1. Yes, I Agree ( if player choose this, when round end set right/left hand )
2. No, I Don't Agree ( if player choose this, kick him )
See pokemonmaster's post
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 08-17-2012 , 16:43   Re: set left/right hand
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
That will kick everyone
How would it kick everyone? Can you explain?
Quote:
Originally Posted by tcPane
His code set left/right hand at round start... I want at round end...
Also I want when set right or left hand, at new round set default hand
HUH?
I will edit it to be at round end, but what default hand???

EDIT: Done, update from my previous post.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 08-17-2012 at 16:48.
pokemonmaster is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-17-2012 , 16:59   Re: set left/right hand
Reply With Quote #8

Quote:
Originally Posted by pokemonmaster View Post
How would it kick everyone? Can you explain?
You do not delete the 15 second timer when they select an option. You also run the risk of kicking a user who hasn't even been presented with the menu yet by not deleting the timer if they select No or they disconnect manually.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 08-17-2012 , 17:10   Re: set left/right hand
Reply With Quote #9

Quote:
Originally Posted by YamiKaitou View Post
You do not delete the 15 second timer when they select an option. You also run the risk of kicking a user who hasn't even been presented with the menu yet by not deleting the timer if they select No or they disconnect manually.
OMG!
I forgot that!

Edit: FIXED NOW!
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 08-17-2012 at 17:14.
pokemonmaster is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-17-2012 , 17:41   Re: set left/right hand
Reply With Quote #10

Quote:
Originally Posted by YamiKaitou View Post
You do not delete the 15 second timer when they select an option.
This still exists
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 04:22.


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