Raised This Month: $32 Target: $400
 8% 

[CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss


Post New Thread Reply   
 
Thread Tools Display Modes
leichenclub
Member
Join Date: Aug 2011
Location: South Germany (BW)
Old 09-16-2012 , 18:59   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #11

Thank you very much! It works fine!
But is there a way to switch out the fire-grenade (molotov) from this process?
Because the fire-grenade slaps you out of the map, if any mate is running throught... It slaps you so often ...

Last edited by leichenclub; 09-16-2012 at 19:02.
leichenclub is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 09-16-2012 , 19:51   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #12

Quote:
Originally Posted by leichenclub View Post
Thank you very much! It works fine!
But is there a way to switch out the fire-grenade (molotov) from this process?
Because the fire-grenade slaps you out of the map, if any mate is running throught... It slaps you so often ...
Yeah, but I don't know the entity names for the Molotov and the fire grenade.
it'll end up being something like this
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

new String:g_strGuns[][] =
{
    
"",
    
"",
    
""
}

#define OUCH_SOUND    "ouch.mp3"
#define IDIOT_SOUND    "idiot.mp3"
#define SLAP_SOUND    false            // false to disable the slap sound in addition to idiot/ouch, true to enable

public Plugin:myinfo = {
    
name "[CS:S/CS:GO] Sounds & Slapping",
    
author "Dr. McKay",
    
description "Requested at https://forums.alliedmods.net/showthread.php?t=195654",
    
version "1.0.0",
    
url "http://www.doctormckay.com"
};

public 
OnPluginStart() {
    
HookEvent("player_hurt"Event_PlayerHurt);
    
HookEvent("bomb_abortplant"Event_AbortPlant);
    
HookEvent("bomb_abortdefuse"Event_AbortDefuse);
}

public 
OnMapStart() {
    
decl String:buffer[256];
    
Format(buffersizeof(buffer), "sound/%s"OUCH_SOUND);
    
AddFileToDownloadsTable(buffer);
    
Format(buffersizeof(buffer), "sound/%s"IDIOT_SOUND);
    
AddFileToDownloadsTable(buffer);
    
PrecacheSound(OUCH_SOUND);
    
PrecacheSound(IDIOT_SOUND);
}

public 
Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast) {
    new 
victim GetClientOfUserId(GetEventInt(event"userid"));
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));
    if ((
victim != attacker) && GetClientTeam(victim) == GetClientTeam(attacker)) {
        
decl String:weapon[32];
        
GetEventString(event"weapon"weaponsizeof(weapon));
        for (new 
0sizeof(g_strGuns); i++)
        {
            if (!
strcmp(weapong_strGuns[i], false))
                return 
Plugin_Continue;
        }
        
EmitSoundToClient(attackerOUCH_SOUND);
        
EmitSoundToClient(victimOUCH_SOUND);
        
SlapPlayer(attacker0SLAP_SOUND);
    }
    return 
Plugin_Continue;
}

public 
Event_AbortPlant(Handle:event, const String:name[], bool:dontBroadcast) {
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
EmitSoundToAll(IDIOT_SOUND);
    
PrintToChatAll("%N aborted planting the bomb!"client);
    
SlapPlayer(client0SLAP_SOUND);
    
CreateTimer(0.5Timer_Slapclient);
}

public 
Event_AbortDefuse(Handle:event, const String:name[], bool:dontBroadcast) {
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
EmitSoundToAll(IDIOT_SOUND);
    
PrintToChatAll("%N aborted defusing the bomb!"client);
    
SlapPlayer(client0SLAP_SOUND);
    
CreateTimer(0.5Timer_Slapclient);
}

public 
Action:Timer_Slap(Handle:timerany:client) {
    
SlapPlayer(client0SLAP_SOUND);

__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 is offline
leichenclub
Member
Join Date: Aug 2011
Location: South Germany (BW)
Old 09-17-2012 , 16:58   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #13

if ((victim != attacker) && GetClientTeam(victim) == GetClientTeam(attacker)) {
decl String:weapon[32];


with the string "weapon[32]" you specified the weapon by number? or should this replaced by something like "molotov"? i don't even know... are the weapons specified by name or number?
leichenclub is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 09-17-2012 , 17:45   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #14

Nope
PHP Code:
new String:g_strGuns[][] = 

    
""
    
""
    
"" 

Add entity names for that and just keep adding until you are done.
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 is offline
leichenclub
Member
Join Date: Aug 2011
Location: South Germany (BW)
Old 09-17-2012 , 18:41   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #15

I found out that the correct name for this weapon is "molotov"
for example ?

new String:g_strGuns[][] =
{
"molotov"
}

Perhaps you coul'd post the sp-file here that outcludes the weapon "molotov" from the slapping (only the ouch_sound could be played - no changes there).

Thank you very much

Last edited by leichenclub; 09-17-2012 at 18:55.
leichenclub is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 09-17-2012 , 20:27   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #16

Quote:
Originally Posted by leichenclub View Post
I found out that the correct name for this weapon is "molotov"
for example ?

new String:g_strGuns[][] =
{
"molotov"
}

Perhaps you coul'd post the sp-file here that outcludes the weapon "molotov" from the slapping (only the ouch_sound could be played - no changes there).

Thank you very much
yeah, like your example but make sure you have the exact entity name.
e.g. weapon_molotov
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 is offline
leichenclub
Member
Join Date: Aug 2011
Location: South Germany (BW)
Old 09-18-2012 , 20:23   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #17

For T it is: weapon_molotov
and for CT: weapon_incgrenade
I checked this by hammer-editor and the game-configs

(For those weapons only play the ouch_sound but without slapping)
please post the edited sp-file ...

Thx mini

Last edited by leichenclub; 09-19-2012 at 17:46. Reason: edited correct weapon-names
leichenclub is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 09-20-2012 , 21:06   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #18

Quote:
Originally Posted by leichenclub View Post
For T it is: weapon_molotov
and for CT: weapon_incgrenade
I checked this by hammer-editor and the game-configs

(For those weapons only play the ouch_sound but without slapping)
please post the edited sp-file ...

Thx mini
new String:g_strGuns[][] =
{
"weapon_molotov",
"weapon_incgrenade"
}

and compile
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 is offline
leichenclub
Member
Join Date: Aug 2011
Location: South Germany (BW)
Old 09-21-2012 , 07:28   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #19

I tried to compile this:

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

new String:g_strGuns[][] =
{
"weapon_molotov",
"weapon_incgrenade"
}

#define OUCH_SOUND "ouch.mp3"
#define IDIOT_SOUND "idiot.mp3"
#define SLAP_SOUND false // false to disable the slap sound in addition to idiot/ouch, true to enable

public Plugin:myinfo = {
name = "[CS:S/CS:GO] Sounds & Slapping",
author = "Dr. McKay",
description = "Requested at https://forums.alliedmods.net/showthread.php?t=195654",
version = "1.0.0",
url = "http://www.doctormckay.com"
};

public OnPluginStart() {
HookEvent("player_hurt", Event_PlayerHurt);
HookEvent("bomb_abortplant", Event_AbortPlant);
HookEvent("bomb_abortdefuse", Event_AbortDefuse);
}

public OnMapStart() {
decl String:buffer[256];
Format(buffer, sizeof(buffer), "sound/%s", OUCH_SOUND);
AddFileToDownloadsTable(buffer);
Format(buffer, sizeof(buffer), "sound/%s", IDIOT_SOUND);
AddFileToDownloadsTable(buffer);
PrecacheSound(OUCH_SOUND);
PrecacheSound(IDIOT_SOUND);
}

public Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast) {
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if ((victim != attacker) && GetClientTeam(victim) == GetClientTeam(attacker)) {
decl String:weapon[32];
GetEventString(event, "weapon", weapon, sizeof(weapon));
for (new i = 0; i < sizeof(g_strGuns); i++)
{
if (!strcmp(weapon, g_strGuns[i], false))
return Plugin_Continue;
}
EmitSoundToClient(attacker, OUCH_SOUND);
EmitSoundToClient(victim, OUCH_SOUND);
SlapPlayer(attacker, 0, SLAP_SOUND);
}
return Plugin_Continue;
}

public Event_AbortPlant(Handle:event, const String:name[], bool:dontBroadcast) {
new client = GetClientOfUserId(GetEventInt(event, "userid"));
EmitSoundToAll(IDIOT_SOUND);
PrintToChatAll("%N aborted planting the bomb!", client);
SlapPlayer(client, 0, SLAP_SOUND);
CreateTimer(0.5, Timer_Slap, client);
}

public Event_AbortDefuse(Handle:event, const String:name[], bool:dontBroadcast) {
new client = GetClientOfUserId(GetEventInt(event, "userid"));
EmitSoundToAll(IDIOT_SOUND);
PrintToChatAll("%N aborted defusing the bomb!", client);
SlapPlayer(client, 0, SLAP_SOUND);
CreateTimer(0.5, Timer_Slap, client);
}

public Action:Timer_Slap(Handle:timer, any:client) {
SlapPlayer(client, 0, SLAP_SOUND);
}


and get this error:

Your plugin failed to compile! Read the errors below:
SourcePawn Compiler 1.4.0
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC
/home/groups/sourcemod/upload_tmp/phpzGKUiM.sp(16) : error 001: expected token: ";", but found "public"
/home/groups/sourcemod/upload_tmp/phpzGKUiM.sp(49) : warning 213: tag mismatch
/home/groups/sourcemod/upload_tmp/phpzGKUiM.sp(55) : warning 213: tag mismatch
1 Error.

Last edited by leichenclub; 09-21-2012 at 07:39.
leichenclub is offline
Snach
Member
Join Date: Jul 2012
Old 09-21-2012 , 13:05   Re: [CS:GO] ! ! ! Simple-Special-Script ! ! ! -> sm-sss
Reply With Quote #20

Quote:
Originally Posted by leichenclub View Post
I tried to compile this:

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

new String:g_strGuns[][] =
{
"weapon_molotov",
"weapon_incgrenade"
} //semicolon?

#define OUCH_SOUND "ouch.mp3"
#define IDIOT_SOUND "idiot.mp3"
#define SLAP_SOUND false // false to disable the slap sound in addition to idiot/ouch, true to enable

public Plugin:myinfo = {
name = "[CS:S/CS:GO] Sounds & Slapping",
author = "Dr. McKay",
description = "Requested at https://forums.alliedmods.net/showthread.php?t=195654",
version = "1.0.0",
url = "http://www.doctormckay.com"
};

public OnPluginStart() {
HookEvent("player_hurt", Event_PlayerHurt);
HookEvent("bomb_abortplant", Event_AbortPlant);
HookEvent("bomb_abortdefuse", Event_AbortDefuse);
}

public OnMapStart() {
decl String:buffer[256];
Format(buffer, sizeof(buffer), "sound/%s", OUCH_SOUND);
AddFileToDownloadsTable(buffer);
Format(buffer, sizeof(buffer), "sound/%s", IDIOT_SOUND);
AddFileToDownloadsTable(buffer);
PrecacheSound(OUCH_SOUND);
PrecacheSound(IDIOT_SOUND);
}
//Action: before event names?
public Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast) {
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if ((victim != attacker) && GetClientTeam(victim) == GetClientTeam(attacker)) {
decl String:weapon[32];
GetEventString(event, "weapon", weapon, sizeof(weapon));
for (new i = 0; i < sizeof(g_strGuns); i++)
{
if (!strcmp(weapon, g_strGuns[i], false))
return Plugin_Continue;
}
EmitSoundToClient(attacker, OUCH_SOUND);
EmitSoundToClient(victim, OUCH_SOUND);
SlapPlayer(attacker, 0, SLAP_SOUND);
}
return Plugin_Continue;
}

public Event_AbortPlant(Handle:event, const String:name[], bool:dontBroadcast) {
new client = GetClientOfUserId(GetEventInt(event, "userid"));
EmitSoundToAll(IDIOT_SOUND);
PrintToChatAll("%N aborted planting the bomb!", client);
SlapPlayer(client, 0, SLAP_SOUND);
CreateTimer(0.5, Timer_Slap, client);
}

public Event_AbortDefuse(Handle:event, const String:name[], bool:dontBroadcast) {
new client = GetClientOfUserId(GetEventInt(event, "userid"));
EmitSoundToAll(IDIOT_SOUND);
PrintToChatAll("%N aborted defusing the bomb!", client);
SlapPlayer(client, 0, SLAP_SOUND);
CreateTimer(0.5, Timer_Slap, client);
}

public Action:Timer_Slap(Handle:timer, any:client) {
SlapPlayer(client, 0, SLAP_SOUND);
}


and get this error:

Your plugin failed to compile! Read the errors below:
SourcePawn Compiler 1.4.0
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC
/home/groups/sourcemod/upload_tmp/phpzGKUiM.sp(16) : error 001: expected token: ";", but found "public"
/home/groups/sourcemod/upload_tmp/phpzGKUiM.sp(49) : warning 213: tag mismatch
/home/groups/sourcemod/upload_tmp/phpzGKUiM.sp(55) : warning 213: tag mismatch
1 Error.

PHP Code:
#pragma semicolon 1 

#include <sourcemod> 
#include <sdktools> 

new String:g_strGuns[][] = { "weapon_molotov""weapon_incgrenade"} ;

#define OUCH_SOUND "ouch.mp3" 
#define IDIOT_SOUND "idiot.mp3" 
#define SLAP_SOUND false // false to disable the slap sound in addition to idiot/ouch, true to enable 

public Plugin:myinfo = { 
    
name "[CS:S/CS:GO] Sounds & Slapping"
    
author "Dr. McKay"
    
description "Requested at https://forums.alliedmods.net/showthread.php?t=195654"
    
version "1.0.0"
    
url "http://www.doctormckay.com" 
}; 

public 
OnPluginStart() { 
    
HookEvent("player_hurt"Event_PlayerHurt); 
    
HookEvent("bomb_abortplant"Event_AbortPlant); 
    
HookEvent("bomb_abortdefuse"Event_AbortDefuse); 


public 
OnMapStart() { 
    
decl String:buffer[256]; 
    
Format(buffersizeof(buffer), "sound/%s"OUCH_SOUND); 
    
AddFileToDownloadsTable(buffer); 
    
Format(buffersizeof(buffer), "sound/%s"IDIOT_SOUND); 
    
AddFileToDownloadsTable(buffer); 
    
PrecacheSound(OUCH_SOUND); 
    
PrecacheSound(IDIOT_SOUND); 


public 
Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast) { 
    new 
victim GetClientOfUserId(GetEventInt(event"userid")); 
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker")); 
    if ((
victim != attacker) && GetClientTeam(victim) == GetClientTeam(attacker)) { 
        
decl String:weapon[32]; 
        
GetEventString(event"weapon"weaponsizeof(weapon)); 
        for (new 
0sizeof(g_strGuns); i++) 
        { 
            if (!
strcmp(weapong_strGuns[i], false)) 
                return 
Plugin_Continue
        } 
        
EmitSoundToClient(attackerOUCH_SOUND); 
        
EmitSoundToClient(victimOUCH_SOUND); 
        
SlapPlayer(attacker0SLAP_SOUND); 
    } 
    return 
Plugin_Continue


public 
Action:Event_AbortPlant(Handle:event, const String:name[], bool:dontBroadcast) { 
    new 
client GetClientOfUserId(GetEventInt(event"userid")); 
    
EmitSoundToAll(IDIOT_SOUND); 
    
PrintToChatAll("%N aborted planting the bomb!"client); 
    
SlapPlayer(client0SLAP_SOUND); 
    
CreateTimer(0.5Timer_Slapclient); 


public 
Action:Event_AbortDefuse(Handle:event, const String:name[], bool:dontBroadcast) { 
    new 
client GetClientOfUserId(GetEventInt(event"userid")); 
    
EmitSoundToAll(IDIOT_SOUND); 
    
PrintToChatAll("%N aborted defusing the bomb!"client); 
    
SlapPlayer(client0SLAP_SOUND); 
    
CreateTimer(0.5Timer_Slapclient); 


public 
Action:Timer_Slap(Handle:timerany:client) { 
    
SlapPlayer(client0SLAP_SOUND); 

Fixed.
Snach 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 15:15.


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