Error to compile [Web compiler]
Hi guys, i need compile a .sp but i have errors, a good person can correct my mistakes please?.
.sp (Is the RoundEndSound++ Plugin).
and a question, i change the name and description of the plugin, is this possible or i need compile with the author name of the plugin and description bla bla bla?
.SP
What is my problem :s ? Thanks.
.sp (Is the RoundEndSound++ Plugin).
and a question, i change the name and description of the plugin, is this possible or i need compile with the author name of the plugin and description bla bla bla?
.SP
Code:
/* *
* ANTiCHRiST RoundSound++
* -------------------------
* Changelog
* changelog.txt
* Readme
* readme.txt
* Credits
* Old CS 1.6 Plugin
* by "PaintLancer"
* Thxs
* To NAT for his help!
* -------------------------
* by pAPARAZi.- para EthernityZone.com!
*/
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>
#include <console>
#include <string>
#pragma semicolon 1
#define PLUGIN_VERSION "1.0.1"
#define MAX_FILE_LEN 256
new Handle:g_hEnabled = INVALID_HANDLE;
new bool:g_bEnabled = true;
public Plugin:myinfo = {
name = "RoundSound++",
author = "ANTiCHRiST",
description = "Plays a Sound at RoundEnd.",
version = PLUGIN_VERSION,
url = "http://passionfighters.de"
};
public OnPluginStart() {
CreateConVar("sm_roundsound_version", PLUGIN_VERSION, "RoundSound++ version.", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
g_hEnabled = CreateConVar("sm_roundsound_enable", "1", "RoundSound++ Enable/Disable CVar.", FCVAR_PLUGIN|FCVAR_NOTIFY);
HookEvent("round_end", EventRoundEnd);
HookConVarChange(g_hEnabled, CVarEnabled);
}
public OnMapStart()
{
decl String:tewin_snd1[MAX_FILE_LEN];
decl String:tewin_snd2[MAX_FILE_LEN];
decl String:tewin_snd3[MAX_FILE_LEN];
decl String:tewin_snd4[MAX_FILE_LEN];
decl String:ctwin_snd1[MAX_FILE_LEN];
decl String:ctwin_snd2[MAX_FILE_LEN];
decl String:ctwin_snd3[MAX_FILE_LEN];
decl String:ctwin_snd4[MAX_FILE_LEN];
Format(tewin_snd1, sizeof(tewin_snd1), "sourcekamikaze/rondas/ganar3.mp3");
Format(tewin_snd2, sizeof(tewin_snd2), "sourcekamikaze/rondas/ganar5.mp3");
Format(tewin_snd3, sizeof(tewin_snd3), "sourcekamikaze/rondas/ganar9.mp3");
Format(tewin_snd4, sizeof(tewin_snd4), "sourcekamikaze/rondas/ganar7.mp3");
Format(ctwin_snd1, sizeof(ctwin_snd1), "sourcekamikaze/rondas/ganar1.wav");
Format(ctwin_snd2, sizeof(ctwin_snd2), "sourcekamikaze/rondas/ganar2.wav");
Format(ctwin_snd3, sizeof(ctwin_snd3), "sourcekamikaze/rondas/ganar8.mp3");
Format(ctwin_snd4, sizeof(ctwin_snd4), "sourcekamikaze/rondas/ganar9.mp3");
if(FileExists(tewin_snd1) && FileExists(tewin_snd2) && FileExists(tewin_snd3) && FileExists(tewin_snd4) && FileExists(ctwin_snd1) && FileExists(ctwin_snd2) && FileExists(ctwin_snd3)) && FileExists(ctwin_snd4)) {
AddFileToDownloadsTable(tewin_snd1);
AddFileToDownloadsTable(tewin_snd2);
AddFileToDownloadsTable(tewin_snd3);
AddFileToDownloadsTable(tewin_snd4);
AddFileToDownloadsTable(ctwin_snd1);
AddFileToDownloadsTable(ctwin_snd2);
AddFileToDownloadsTable(ctwin_snd3);
AddFileToDownloadsTable(ctwin_snd4);
PrecacheSound("sourcekamikaze/rondas/ganar3.mp3", true);
PrecacheSound("sourcekamikaze/rondas/ganar5.mp3", true);
PrecacheSound("sourcekamikaze/rondas/ganar9.mp3", true);
PrecacheSound("sourcekamikaze/rondas/ganar7.mp3", true);
PrecacheSound("sourcekamikaze/rondas/ganar1.mp3", true);
PrecacheSound("sourcekamikaze/rondas/ganar2.mp3", true);
PrecacheSound("sourcekamikaze/rondas/ganar8.mp3", true);
PrecacheSound("sourcekamikaze/rondas/ganar9.mp3", true);
}
else {
LogError("Not all sound files exists.");
LogError("Unload the Plugin.");
ServerCommand("sm plugins unload \"RoundSound++.smx\"");
}
}
public OnConfigsExecuted() {
if(GetConVarBool(g_hEnabled)) {
g_bEnabled = true;
}
else if(!GetConVarBool(g_hEnabled)) {
g_bEnabled = false;
}
else {
g_bEnabled = true;
LogError("False value plugin continued");
}
}
public CVarEnabled(Handle:convar, const String:oldValue[], const String:newValue[]) {
if(GetConVarBool(g_hEnabled)) {
g_bEnabled = true;
}
else if(!GetConVarBool(g_hEnabled)) {
g_bEnabled = false;
}
else {
g_bEnabled = true;
LogError("False value plugin continued");
}
}
public EventRoundEnd(Handle:event, const String:name[], bool:dontBroadcast) {
new rnd_sound = GetRandomInt(1, 4);
new ev_winner = GetEventInt(event, "winner");
if(g_bEnabled) {
if(ev_winner == 2) {
if(rnd_sound == 1) {
EmitSoundToAll("sourcekamikaze/rondas/ganar3.mp3");
}
else if(rnd_sound == 2) {
EmitSoundToAll("sourcekamikaze/rondas/ganar5.mp3");
}
else if(rnd_sound == 3) {
EmitSoundToAll("sourcekamikaze/rondas/ganar9.mp3");
}
else if(rnd_sound == 4) {
EmitSoundToAll("sourcekamikaze/rondas/ganar7.mp3");
}
else {
LogError("Ramdom Sound CVar Error.");
}
}
else if(ev_winner == 4) {
if(rnd_sound == 1) {
EmitSoundToAll("sourcekamikaze/rondas/ganar1.wav");
}
else if(rnd_sound == 2) {
EmitSoundToAll("sourcekamikaze/rondas/ganar2.wav");
}
else if(rnd_sound == 3) {
EmitSoundToAll("sourcekamikaze/rondas/ganar8.mp3");
}
else if(rnd_sound == 4) {
EmitSoundToAll("sourcekamikaze/rondas/ganar9.mp3");
}
else {
LogError("Ramdom Sound CVar Error.");
}
}
else {
LogError("No team has win the round.");
}
}
}
Orignal From: Error to compile [Web compiler]
Post a Comment