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

Add a message to this ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 12-09-2015 , 05:04   Add a message to this ?
Reply With Quote #1

Can someone add a message to this ?
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>

#define LAST_C4_TIME 60

float g_flNextC4PlantTime;

public 
void OnPluginStart() {
    
HookEvent("round_start"OnRoundStartEventHookMode_Post);
}

public 
void OnRoundStart(Event event, const char[] namebool dontBroadcast) {
    
g_flNextC4PlantTime GetGameTime() + float(GameRules_GetProp("m_iRoundTime") - LAST_C4_TIME);
}

public 
Action OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon, &subtype, &cmdnum, &tickcount, &seedmouse[2]) {
    if (
IsPlayerAlive(client)) {
        if (
GetEntPropEnt(clientProp_Data"m_hActiveWeapon") == GetPlayerWeaponSlot(clientCS_SLOT_C4) && GetGameTime() < g_flNextC4PlantTime) {
            if (
buttons IN_ATTACK) {
                
buttons &= ~IN_ATTACK;
            }
            if (
buttons IN_USE) {
                
buttons &= ~IN_USE;
            }
        }
    }

Something like:
You can't plant the bomb until the last minute of the round.
So the players will know why they have a bomb that cannot be planted...
Edit: I want the message to be displayed on the middle of the screen(PrintHintText).
__________________

Last edited by valio_skull; 12-09-2015 at 05:21. Reason: add more
valio_skull is offline
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 12-09-2015 , 05:40   Re: Add a message to this ?
Reply With Quote #2

Nevermind, I'm dumb...
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>

#define LAST_C4_TIME 60

float g_flNextC4PlantTime;

public 
void OnPluginStart() {
    
HookEvent("round_start"OnRoundStartEventHookMode_Post);
}

public 
void OnRoundStart(Event event, const char[] namebool dontBroadcast) {
    
g_flNextC4PlantTime GetGameTime() + float(GameRules_GetProp("m_iRoundTime") - LAST_C4_TIME);
}

public 
Action OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon, &subtype, &cmdnum, &tickcount, &seedmouse[2]) {
    if (
IsPlayerAlive(client)) {
        if (
GetEntPropEnt(clientProp_Data"m_hActiveWeapon") == GetPlayerWeaponSlot(clientCS_SLOT_C4) && GetGameTime() < g_flNextC4PlantTime) {
            
PrintHintText(client"You can't plant the bomb until the last minute of the round.");
            if (
buttons IN_ATTACK) {
                
buttons &= ~IN_ATTACK;
            }
            if (
buttons IN_USE) {
                
buttons &= ~IN_USE;
            }
        }
    }

__________________
valio_skull is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 12-09-2015 , 06:09   Re: Add a message to this ?
Reply With Quote #3

U are missing if player is on bombsite
ESK0 is offline
valio_skull
Senior Member
Join Date: Jan 2013
Location: at home
Old 12-09-2015 , 07:44   Re: Add a message to this ?
Reply With Quote #4

Quote:
Originally Posted by ESK0 View Post
U are missing if player is on bombsite
I don't know how to add this...if you can help me, that would be great
__________________
valio_skull is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 12-12-2015 , 15:44   Re: Add a message to this ?
Reply With Quote #5

There is a m_bInBombZone variable however i currently dont know if its Prop_Data or Prop_Send i would assume its Prop_Send
xerox8521 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 12:55.


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