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

[HELP] Cant get this to compile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
terminator18
Member
Join Date: Feb 2013
Location: Athens,Greece
Old 06-19-2015 , 11:30   [HELP] Cant get this to compile
Reply With Quote #1

Hello. I know that this topic might be a little silly but i can't get this plugin to compile.

PHP Code:
/**
 * vim: set ts=4 :
 * =============================================================================
 * SourceMod Basic Fun Commands Plugin
 * Implements basic punishment commands.
 *
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
 * =============================================================================
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, version 3.0, as published by the
 * Free Software Foundation.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * As a special exception, AlliedModders LLC gives you permission to link the
 * code of this program (as well as its derivative works) to "Half-Life 2," the
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
 * by the Valve Corporation.  You must obey the GNU General Public License in
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
 * this exception to all derivative works.  AlliedModders LLC defines further
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
 * or <http://www.sourcemod.net/license.php>.
 *
 * Version: $Id$
 */

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#undef REQUIRE_PLUGIN
#include <adminmenu>

public Plugin:myinfo =
{
    
name "Fun Commands",
    
author "AlliedModders LLC",
    
description "Fun Commands",
    
version SOURCEMOD_VERSION,
    
url "http://www.sourcemod.net/"
};

// Admin Menu
TopMenu hTopMenu;

// Sounds
new String:g_BlipSound[PLATFORM_MAX_PATH];
new 
String:g_BeepSound[PLATFORM_MAX_PATH];
new 
String:g_FinalSound[PLATFORM_MAX_PATH];
new 
String:g_BoomSound[PLATFORM_MAX_PATH];
new 
String:g_FreezeSound[PLATFORM_MAX_PATH];

// Following are model indexes for temp entities
new g_BeamSprite        = -1;
new 
g_BeamSprite2       = -1;
new 
g_HaloSprite        = -1;
new 
g_GlowSprite        = -1;
new 
g_ExplosionSprite   = -1;

// Basic color arrays for temp entities
new redColor[4]        = {2557575255};
new 
orangeColor[4]    = {2551280255};
new 
greenColor[4]    = {7525575255};
new 
blueColor[4]    = {7575255255};
new 
whiteColor[4]    = {255255255255};
new 
greyColor[4]    = {128128128255};

// UserMessageId for Fade.
new UserMsg:g_FadeUserMsgId;

// Serial Generator for Timer Safety
new g_Serial_Gen 0;

new 
EngineVersion:g_GameEngine Engine_Unknown;

// Flags used in various timers
#define DEFAULT_TIMER_FLAGS TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE

// Include various commands and supporting functions
#include "funcommands/beacon.sp"
#include "funcommands/timebomb.sp"
#include "funcommands/fire.sp"
#include "funcommands/ice.sp"
#include "funcommands/gravity.sp"
#include "funcommands/blind.sp"
#include "funcommands/noclip.sp"
#include "funcommands/drug.sp"

public OnPluginStart()
{
    if (
FindPluginByFile("basefuncommands.smx") != null)
    {
        
ThrowError("This plugin replaces basefuncommands.  You cannot run both at once.");
    }
    
    
LoadTranslations("common.phrases");
    
LoadTranslations("funcommands.phrases");
    
g_GameEngine GetEngineVersion();
    
g_FadeUserMsgId GetUserMessageId("Fade");

    
RegisterCvars( );
    
RegisterCmds( );
    
HookEvents( );
    
    
/* Account for late loading */
    
TopMenu topmenu;
    if (
LibraryExists("adminmenu") && ((topmenu GetAdminTopMenu()) != null))
    {
        
OnAdminMenuReady(topmenu);
    }
}

RegisterCvars( )
{
    
// beacon
    
g_Cvar_BeaconRadius CreateConVar("sm_beacon_radius""375""Sets the radius for beacon's light rings."0true50.0true1500.0);

    
// timebomb
    
g_Cvar_TimeBombTicks CreateConVar("sm_timebomb_ticks""10.0""Sets how long the timebomb fuse is."0true5.0true120.0);
    
g_Cvar_TimeBombRadius CreateConVar("sm_timebomb_radius""600""Sets the bomb blast radius."0true50.0true3000.0);
    
g_Cvar_TimeBombMode CreateConVar("sm_timebomb_mode""0""Who is killed by the timebomb? 0 = Target only, 1 = Target's team, 2 = Everyone"0true0.0true2.0);
    
    
// fire
    
g_Cvar_BurnDuration CreateConVar("sm_burn_duration""20.0""Sets the default duration of sm_burn and firebomb victims."0true0.5true20.0);
    
g_Cvar_FireBombTicks CreateConVar("sm_firebomb_ticks""10.0""Sets how long the FireBomb fuse is."0true5.0true120.0);
    
g_Cvar_FireBombRadius CreateConVar("sm_firebomb_radius""600""Sets the bomb blast radius."0true50.0true3000.0);
    
g_Cvar_FireBombMode CreateConVar("sm_firebomb_mode""0""Who is targetted by the FireBomb? 0 = Target only, 1 = Target's team, 2 = Everyone"0true0.0true2.0);
    
    
// ice
    
g_Cvar_FreezeDuration CreateConVar("sm_freeze_duration""10.0""Sets the default duration for sm_freeze and freezebomb victims"0true1.0true120.0);    
    
g_Cvar_FreezeBombTicks CreateConVar("sm_freezebomb_ticks""10.0""Sets how long the freezebomb fuse is."0true5.0true120.0);
    
g_Cvar_FreezeBombRadius CreateConVar("sm_freezebomb_radius""600""Sets the freezebomb blast radius."0true50.0true3000.0);
    
g_Cvar_FreezeBombMode CreateConVar("sm_freezebomb_mode""0""Who is targetted by the freezebomb? 0 = Target only, 1 = Target's team, 2 = Everyone"0true0.0true2.0);
    
    
AutoExecConfig(true"funcommands");
}

RegisterCmds( )
{
    
RegAdminCmd("sm_beacon"Command_BeaconADMFLAG_SLAY"sm_beacon <#userid|name> [0/1]");
    
RegAdminCmd("sm_timebomb"Command_TimeBombADMFLAG_SLAY"sm_timebomb <#userid|name> [0/1]");
    
RegAdminCmd("sm_burn"Command_BurnADMFLAG_SLAY"sm_burn <#userid|name> [time]");
    
RegAdminCmd("sm_firebomb"Command_FireBombADMFLAG_SLAY"sm_firebomb <#userid|name> [0/1]");
    
RegAdminCmd("sm_freeze"Command_FreezeADMFLAG_SLAY"sm_freeze <#userid|name> [time]");
    
RegAdminCmd("sm_freezebomb"Command_FreezeBombADMFLAG_SLAY"sm_freezebomb <#userid|name> [0/1]");
    
RegAdminCmd("sm_gravity"Command_GravityADMFLAG_SLAY"sm_gravity <#userid|name> [amount] - Leave amount off to reset. Amount is 0.0 through 5.0");
    
RegAdminCmd("sm_blind"Command_BlindADMFLAG_SLAY"sm_blind <#userid|name> [amount] - Leave amount off to reset.");
    
RegAdminCmd("sm_noclip"Command_NoClipADMFLAG_SLAY"sm_noclip <#userid|name>");
    
RegAdminCmd("sm_drug"Command_DrugADMFLAG_SLAY"sm_drug <#userid|name> [0/1]");
}

HookEvents( )
{
    
decl String:folder[64];
    
GetGameFolderName(foldersizeof(folder));

    if (
strcmp(folder"tf") == 0)
    {
        
HookEvent("teamplay_win_panel"Event_RoundEndEventHookMode_PostNoCopy);
        
HookEvent("teamplay_restart_round"Event_RoundEndEventHookMode_PostNoCopy);
        
HookEvent("arena_win_panel"Event_RoundEndEventHookMode_PostNoCopy);
    }
    else if (
strcmp(folder"nucleardawn") == 0)
    {
        
HookEvent("round_win"Event_RoundEndEventHookMode_PostNoCopy);
    }
    else
    {
        
HookEvent("round_end"Event_RoundEndEventHookMode_PostNoCopy);
    }    
}

public 
OnMapStart()
{
    new 
Handle:gameConfig LoadGameConfigFile("funcommands.games");
    if (
gameConfig == null)
    {
        
SetFailState("Unable to load game config funcommands.games");
        return;
    }
    
    if (
GameConfGetKeyValue(gameConfig"SoundBlip"g_BlipSoundsizeof(g_BlipSound)) && g_BlipSound[0])
    {
        
PrecacheSound(g_BlipSoundtrue);
    }
    
    if (
GameConfGetKeyValue(gameConfig"SoundBeep"g_BeepSoundsizeof(g_BeepSound)) && g_BeepSound[0])
    {
        
PrecacheSound(g_BeepSoundtrue);
    }
    
    if (
GameConfGetKeyValue(gameConfig"SoundFinal"g_FinalSoundsizeof(g_FinalSound)) && g_FinalSound[0])
    {
        
PrecacheSound(g_FinalSoundtrue);
    }
    
    if (
GameConfGetKeyValue(gameConfig"SoundBoom"g_BoomSoundsizeof(g_BoomSound)) && g_BoomSound[0])
    {
        
PrecacheSound(g_BoomSoundtrue);
    }
    
    if (
GameConfGetKeyValue(gameConfig"SoundFreeze"g_FreezeSoundsizeof(g_FreezeSound)) && g_FreezeSound[0])
    {
        
PrecacheSound(g_FreezeSoundtrue);
    }
    
    new 
String:buffer[PLATFORM_MAX_PATH];
    if (
GameConfGetKeyValue(gameConfig"SpriteBeam"buffersizeof(buffer)) && buffer[0])
    {
        
g_BeamSprite PrecacheModel(buffer);
    }
    
    if (
GameConfGetKeyValue(gameConfig"SpriteBeam2"buffersizeof(buffer)) && buffer[0])
    {
        
g_BeamSprite2 PrecacheModel(buffer);
    }
    
    if (
GameConfGetKeyValue(gameConfig"SpriteExplosion"buffersizeof(buffer)) && buffer[0])
    {
        
g_ExplosionSprite PrecacheModel(buffer);
    }
    
    if (
GameConfGetKeyValue(gameConfig"SpriteGlow"buffersizeof(buffer)) && buffer[0])
    {
        
g_GlowSprite PrecacheModel(buffer);
    }
    
    if (
GameConfGetKeyValue(gameConfig"SpriteHalo"buffersizeof(buffer)) && buffer[0])
    {
        
g_HaloSprite PrecacheModel(buffer);
    }
    
    
delete gameConfig;
}

public 
OnMapEnd()
{
    
KillAllBeacons( );
    
KillAllTimeBombs();
    
KillAllFireBombs();
    
KillAllFreezes();
    
KillAllDrugs();
}

public 
Action:Event_RoundEnd(Handle:event,const String:name[],bool:dontBroadcast)
{
    
KillAllBeacons( );
    
KillAllTimeBombs();
    
KillAllFireBombs();
    
KillAllFreezes();
    
KillAllDrugs();
}

public 
OnAdminMenuReady(Handle aTopMenu)
{
    
TopMenu topmenu TopMenu.FromHandle(aTopMenu);

    
/* Block us from being called twice */
    
if (topmenu == hTopMenu)
    {
        return;
    }
    
    
/* Save the Handle */
    
hTopMenu topmenu;
    
    
/* Find the "Player Commands" category */
    
TopMenuObject player_commands hTopMenu.FindCategory(ADMINMENU_PLAYERCOMMANDS);

    if (
player_commands != INVALID_TOPMENUOBJECT)
    {
        
hTopMenu.AddItem("sm_beacon"AdminMenu_Beaconplayer_commands"sm_beacon"ADMFLAG_SLAY);
        
hTopMenu.AddItem("sm_timebomb"AdminMenu_TimeBombplayer_commands"sm_timebomb"ADMFLAG_SLAY);
        
hTopMenu.AddItem("sm_burn"AdminMenu_Burnplayer_commands"sm_burn"ADMFLAG_SLAY);
        
hTopMenu.AddItem("sm_firebomb"AdminMenu_FireBombplayer_commands"sm_firebomb"ADMFLAG_SLAY);
        
hTopMenu.AddItem("sm_freeze"AdminMenu_Freezeplayer_commands"sm_freeze"ADMFLAG_SLAY);
        
hTopMenu.AddItem("sm_freezebomb"AdminMenu_FreezeBombplayer_commands"sm_freezebomb"ADMFLAG_SLAY);
        
hTopMenu.AddItem("sm_gravity"AdminMenu_Gravityplayer_commands"sm_gravity"ADMFLAG_SLAY);
        
hTopMenu.AddItem("sm_blind"AdminMenu_Blindplayer_commands"sm_blind"ADMFLAG_SLAY);
        
hTopMenu.AddItem("sm_noclip"AdminMenu_NoClipplayer_commands"sm_noclip"ADMFLAG_SLAY);
        
hTopMenu.AddItem("sm_drug"AdminMenu_Drugplayer_commands"sm_drug"ADMFLAG_SLAY);
    }
}

void AddTranslatedMenuItem(Menu menu, const char[] opt, const char[] phraseint client)
{
    
char buffer[128];
    
Format(buffersizeof(buffer), "%T"phraseclient);
    
menu.AddItem(optbuffer);

Attached Files
File Type: sp Get Plugin or Get Source (funcommands.sp - 61 views - 10.8 KB)
terminator18 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 06-19-2015 , 12:10   Re: [HELP] Cant get this to compile
Reply With Quote #2

I'm not sure why you feel the need to compile this yourself, but make sure that the file is in the right directory when you compile it. If in doubt, download sourcemod again and take a look where it's located.
__________________

Last edited by Impact123; 06-19-2015 at 12:11.
Impact123 is offline
DJ Data
SourceMod Donor
Join Date: Dec 2012
Location: Switzerland
Old 06-19-2015 , 14:29   Re: [HELP] Cant get this to compile
Reply With Quote #3

Can you show us the error log?
__________________
SourcePawn Coding Level: Novice
DJ Data is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-19-2015 , 17:23   Re: [HELP] Cant get this to compile
Reply With Quote #4

Do you have these files? Without them, it won't compile...
Code:
funcommands/beacon.sp
funcommands/timebomb.sp
funcommands/fire.sp
funcommands/ice.sp
funcommands/gravity.sp
funcommands/blind.sp
funcommands/noclip.sp
funcommands/drug.sp
P.S.: Make sure you compile it on compiler that supports new syntax.

Last edited by KissLick; 06-19-2015 at 17:25.
KissLick is offline
terminator18
Member
Join Date: Feb 2013
Location: Athens,Greece
Old 06-20-2015 , 08:52   Re: [HELP] Cant get this to compile
Reply With Quote #5

Quote:
Originally Posted by Impact123 View Post
I'm not sure why you feel the need to compile this yourself, but make sure that the file is in the right directory when you compile it. If in doubt, download sourcemod again and take a look where it's located.
I have changed some access flags for the fun commands...thats why i want to compile it by myself.

Quote:
Originally Posted by DJ Data View Post
Can you show us the error log?
fatal error 182: cannot read from file: "funcommands/beacon.sp"


Quote:
Originally Posted by KissLick View Post
Do you have these files? Without them, it won't compile...
Code:
funcommands/beacon.sp
funcommands/timebomb.sp
funcommands/fire.sp
funcommands/ice.sp
funcommands/gravity.sp
funcommands/blind.sp
funcommands/noclip.sp
funcommands/drug.sp
P.S.: Make sure you compile it on compiler that supports new syntax.
Yeah I do. What do you mean with the compiler that supports new syntax?
terminator18 is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-20-2015 , 09:15   Re: [HELP] Cant get this to compile
Reply With Quote #6

Quote:
Originally Posted by terminator18 View Post
fatal error 182: cannot read from file: "funcommands/beacon.sp"
Compiler can't read/find "funcommands/beacon.sp" file (check read access rights).

Quote:
Originally Posted by terminator18 View Post
What do you mean with the compiler that supports new syntax?
Just compile it with the latest compiler and it should be OK.

P.S.: Your file hierarchy should be:
Code:
funcommands.sp
funcommands/beacon.sp
funcommands/timebomb.sp
funcommands/fire.sp
funcommands/ice.sp
funcommands/gravity.sp
funcommands/blind.sp
funcommands/noclip.sp
funcommands/drug.sp
KissLick is offline
terminator18
Member
Join Date: Feb 2013
Location: Athens,Greece
Old 06-20-2015 , 09:34   Re: [HELP] Cant get this to compile
Reply With Quote #7

Quote:
Originally Posted by KissLick View Post
Compiler can't read/find "funcommands/beacon.sp" file (check read access rights).

Just compile it with the latest compiler and it should be OK.

P.S.: Your file hierarchy should be:
Code:
funcommands.sp
funcommands/beacon.sp
funcommands/timebomb.sp
funcommands/fire.sp
funcommands/ice.sp
funcommands/gravity.sp
funcommands/blind.sp
funcommands/noclip.sp
funcommands/drug.sp
I havent moved anything..and the sourcemod compiler is the latest.
terminator18 is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 06-20-2015 , 10:12   Re: [HELP] Cant get this to compile
Reply With Quote #8

Did you check read access rights?
KissLick is offline
terminator18
Member
Join Date: Feb 2013
Location: Athens,Greece
Old 06-20-2015 , 10:24   Re: [HELP] Cant get this to compile
Reply With Quote #9

Quote:
Originally Posted by KissLick View Post
Did you check read access rights?
Yes
terminator18 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 06-20-2015 , 14:30   Re: [HELP] Cant get this to compile
Reply With Quote #10

Quote:
Originally Posted by terminator18 View Post
I have changed some access flags for the fun commands...
You can do this without changing the code.
__________________
Impact123 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 14:49.


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