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

Solved How i can compile this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vegeta1241
AlliedModders Donor
Join Date: Apr 2017
Location: Switzerland
Old 10-06-2018 , 12:16   How i can compile this plugin
Reply With Quote #1

Hello, how i can compile this plugin because when i compile it with source mod i have this error

/groups/sourcemod/upload_tmp/textzITLBF.sp(3) : fatal error 182: cannot read from file: "emitsoundany"

Code:
#include <sourcemod> 
#include <cstrike> 
#include <emitsoundany> 

public void OnPluginStart() 
{ 
    HookEvent("player_death", PlayerDeath); 
} 

public OnMapStart() 
{ 
    AddFileToDownloadsTable("sound/sourcemod/customdeathsound/sound.mp3"); 
    PrecacheSoundAny("sourcemod/customdeathsound/sound.mp3"); 
}  

public Action PlayerDeath(Event event, const char[] name, bool dontBroadcast) 
{ 
    int client = GetClientOfUserId(GetEventInt(event, "userid")); 
    int team = GetClientTeam(client); 

    if(team == CS_TEAM_T && IsValidClient(client)) 
    { 
        EmitSoundToClientAny(client, "sourcemod/customdeathsound/sound.mp3"); 
    } 

    return Plugin_Continue; 
} 

public bool IsValidClient(int client) 
{ 
    if(client <= 0 ) return false; 
    if(client > MaxClients) return false; 
    if(!IsClientConnected(client)) return false; 
    return IsClientInGame(client); 
}

Last edited by vegeta1241; 10-08-2018 at 13:51.
vegeta1241 is offline
2389736818
Member
Join Date: Jul 2014
Location: China
Old 10-06-2018 , 12:28   Re: How i can compile this plugin
Reply With Quote #2

emitsoundany in here:https://forums.alliedmods.net/showthread.php?t=237045
__________________
2389736818 is offline
vegeta1241
AlliedModders Donor
Join Date: Apr 2017
Location: Switzerland
Old 10-06-2018 , 13:11   Re: How i can compile this plugin
Reply With Quote #3

I Know but i dont have software to script, i script m’y plugin On web compiler. Somebody can compile this for me ?
vegeta1241 is offline
Cruze
Veteran Member
Join Date: May 2017
Old 10-06-2018 , 13:16   Re: How i can compile this plugin
Reply With Quote #4

Copy your .sp file here
Code:
addons/sourcemod/scripting
drag to "compile" to compile the plugin. check addons/sourcemod/scripting/compiled.
__________________
Taking paid private requests! Contact me
Cruze is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 10-06-2018 , 13:26   Re: How i can compile this plugin
Reply With Quote #5

You dont need emitsoundany so you could compile this code here -> https://www.sourcemod.net/compiler.php

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

public void OnPluginStart() 

    
HookEvent("player_death"PlayerDeath); 


public 
OnMapStart() 

    
AddFileToDownloadsTable("sound/sourcemod/customdeathsound/sound.mp3"); 
    
PrecacheSound("sourcemod/customdeathsound/sound.mp3"); 
}  

public 
Action PlayerDeath(Event event, const char[] namebool dontBroadcast

    
int client GetClientOfUserId(GetEventInt(event"userid")); 
    
int team GetClientTeam(client); 

    if(
team == CS_TEAM_T && IsValidClient(client)) 
    { 
        
EmitSoundToClient(client"sourcemod/customdeathsound/sound.mp3"); 
    } 

    return 
Plugin_Continue


public 
bool IsValidClient(int client

    if(
client <= ) return false
    if(
client MaxClients) return false
    if(!
IsClientConnected(client)) return false
    return 
IsClientInGame(client); 

__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-06-2018 , 16:14   Re: How i can compile this plugin
Reply With Quote #6

What Franc1sco said.

emitsoundany is pointless now due to Valve updating CS:GO.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 10-06-2018 , 16:19   Re: How i can compile this plugin
Reply With Quote #7

Quote:
Originally Posted by Powerlord View Post
What Franc1sco said.

emitsoundany is pointless now due to Valve updating CS:GO.
Exactly, its the first that you say in the thread "As of a 2018 CS:GO update, this include is no longer necessary", so no idea why some people still using it on new plugins.

Maybe you could set it on red color because is more striking.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 10-06-2018 at 16:22.
Franc1sco is offline
Send a message via MSN to Franc1sco
vegeta1241
AlliedModders Donor
Join Date: Apr 2017
Location: Switzerland
Old 10-06-2018 , 16:30   Re: How i can compile this plugin
Reply With Quote #8

yes but i test this plugin, the sound its downloading on serv but not emit when terrorist die
vegeta1241 is offline
vegeta1241
AlliedModders Donor
Join Date: Apr 2017
Location: Switzerland
Old 10-06-2018 , 17:05   Re: How i can compile this plugin
Reply With Quote #9

Quote:
Originally Posted by Cruze View Post
Copy your .sp file here
Code:
addons/sourcemod/scripting
drag to "compile" to compile the plugin. check addons/sourcemod/scripting/compiled.
i can't drag to compile with filezila ...
vegeta1241 is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 10-06-2018 , 17:26   Re: How i can compile this plugin
Reply With Quote #10

Quote:
Originally Posted by vegeta1241 View Post
yes but i test this plugin, the sound its downloading on serv but not emit when terrorist die
Try this in your client console:
Code:
play customdeathsound/sound.mp3
If dont work then it will say why.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
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:30.


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