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

[Block Buttons] Jailbreak


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PriceLess
Senior Member
Join Date: Sep 2012
Location: Jungle
Old 02-28-2013 , 13:22   [Block Buttons] Jailbreak
Reply With Quote #1

Hi there, im testing out some new stuff for my server..

The issue I'm having I sew the tuts at wiki. But how can I make them virutualy press a button?

Like etc. Shift or ctrl. I figgured out how to block them, but didnt help out much.. Is this possible?
__________________
sincerely PriceLess
PriceLess is offline
K0Killer2
SourceMod Donor
Join Date: Aug 2012
Location: Florida
Old 02-28-2013 , 13:30   Re: [Block Buttons] Jailbreak
Reply With Quote #2

PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    
buttons |= IN_DUCK;

__________________

Last edited by K0Killer2; 02-28-2013 at 13:34.
K0Killer2 is offline
PriceLess
Senior Member
Join Date: Sep 2012
Location: Jungle
Old 02-28-2013 , 13:49   Re: [Block Buttons] Jailbreak
Reply With Quote #3

When i execute the command the only error that appears 100's time per second is Can't find second player or something like that.
And it says unknown command. But it prints out the message obviously.

PHP Code:
#include <sourcemod>
#include <sdktools>

new PandaFreeday 0;
new 
ZombieFreeday 0;

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_panda"Panda);
    
RegConsoleCmd("sm_zombie"Zombie);
}

public 
Action:Panda(clientargs)
{
    
PandaFreeday 1;
    
PrintToChatAll("Panda freeday");
}

public 
Action:Zombie(clientargs)
{
    
ZombieFreeday 1;
    
PrintToChatAll("Zombie freeday");
}
    

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    for (new 
1GetMaxClients(); i++)
    {
        if(
GetClientTeam(i) == 2)
        {
            if(
PandaFreeday == 1)
            {
                
buttons |= IN_DUCK;
                
buttons |= IN_LEFT;
            }
            return 
Plugin_Continue;
            
            if(
ZombieFreeday == 1)
            {
                
buttons |= IN_WALK;
                
buttons |= IN_RIGHT;
            }
            return 
Plugin_Continue;
        }
    }

__________________
sincerely PriceLess
PriceLess is offline
K0Killer2
SourceMod Donor
Join Date: Aug 2012
Location: Florida
Old 02-28-2013 , 13:52   Re: [Block Buttons] Jailbreak
Reply With Quote #4

The loop wasn't needed. You also had returns in random places.

PHP Code:
#include <sourcemod> 
#include <sdktools> 

new PandaFreeday 0
new 
ZombieFreeday 0

public 
OnPluginStart() 

    
RegConsoleCmd("sm_panda"Panda); 
    
RegConsoleCmd("sm_zombie"Zombie); 


public 
Action:Panda(clientargs

    
PandaFreeday 1
    
PrintToChatAll("Panda freeday"); 


public 
Action:Zombie(clientargs

    
ZombieFreeday 1
    
PrintToChatAll("Zombie freeday"); 

     

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon

    if(
GetClientTeam(client) == 2
    { 
        if(
PandaFreeday == 1
        { 
            
buttons |= IN_DUCK
            
buttons |= IN_LEFT
        }  
        if(
ZombieFreeday == 1
        { 
            
buttons |= IN_WALK
            
buttons |= IN_RIGHT;
        } 
    }


Last edited by K0Killer2; 02-28-2013 at 14:06.
K0Killer2 is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 02-28-2013 , 14:07   Re: [Block Buttons] Jailbreak
Reply With Quote #5

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

#pragma semicolon 1

new Day;

public 
Plugin:myinfo =
{
    
name "Jailbreak Days",
    
author "PriceLess",
    
description "Jailbreak days, duh",
    
version "1.0"
}

public 
OnPluginStart()
{
    
RegAdminCmd("sm_panda"PandaDayADMFLAG_GENERIC"Activate \"Panda Day\"");
    
RegAdminCmd("sm_zombie"ZombieDayADMFLAG_GENERIC"Activate \"Zombie Day\"");
    
RegAdminCmd("sm_nodays"NoDaysADMFLAG_GENERIC"Disable all Jailbreak days.");
}

public 
Action:NoDays(clientargs)
{
    if(!
IsValidClient(client))
    {
        return 
Plugin_Handled;
    }

    
Day 0;

    
ReplyToCommand(client"\x04[SM]\x01 No days are activated.");

    return 
Plugin_Handled;
}

public 
Action:PandaDay(clientargs)

    if(!
IsValidClient(client))
    {
        return 
Plugin_Handled;
    }

    
Day 1;

    
ReplyToCommand(client"\x04[SM]\x01 Panda day is activated.");

    return 
Plugin_Handled;
}

public 
Action:ZombieDay(clientargs)
{
    if(!
IsValidClient(client))
    {
        return 
Plugin_Handled;
    }

    
Day 2;

    
ReplyToCommand(client"\x04[SM]\x01 Zombie day is activated.");

    return 
Plugin_Handled;
}
     

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon
{
    if(!
IsValidClient(clienttrue))
    {
        return 
Plugin_Continue;
    }

    if(
GetClientTeam(client) == CS_TEAM_T
    {
        switch(
Day)
        {
            case 
1:
            {
                
buttons |= IN_DUCK;
                
buttons |= IN_LEFT;
            }

            case 
2:
            {
                
buttons |= IN_WALK;
                
buttons |= IN_RIGHT;
            }

            default:
            {
                return 
Plugin_Continue;
            }
        }
    }

    return 
Plugin_Continue;
}

stock bool:IsValidClient(clientbool:bAlive false)
{
    if(
client >= && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && (bAlive == false || IsPlayerAlive(client)))
    {
        return 
true;
    }
    
    return 
false;

__________________
retired
shavit is offline
K0Killer2
SourceMod Donor
Join Date: Aug 2012
Location: Florida
Old 02-28-2013 , 14:10   Re: [Block Buttons] Jailbreak
Reply With Quote #6

Can a client running a command be invalid? I don't see why you need to check for that.
__________________
K0Killer2 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-28-2013 , 14:14   Re: [Block Buttons] Jailbreak
Reply With Quote #7

If you're going to check every player, you might was well do it on a 0.1 sec timer or in OnGameFrame.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-28-2013 at 14:14.
Powerlord is offline
PriceLess
Senior Member
Join Date: Sep 2012
Location: Jungle
Old 02-28-2013 , 16:10   Re: [Block Buttons] Jailbreak
Reply With Quote #8

For some reason the buttons doesn't force on zombie?
__________________
sincerely PriceLess
PriceLess 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 19:19.


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