AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved Having trouble with compiling (https://forums.alliedmods.net/showthread.php?t=316321)

francisb 05-17-2019 12:16

Having trouble with compiling
 
Hey, I'm new to this type of stuff and I don't really understand what to do.

So what I'm trying to do is create custom commands and when executed printing a message to chat. When compiling on https://www.sourcemod.net/compiler.php I get this error:

Code:

/home/groups/sourcemod/upload_tmp/phpT5ft37.sp(2) : fatal error 182: cannot read from file: "colors"

Compilation aborted.
1 Error.

I understand what the problem is, although I don't understand how to fix it.

The code I'm trying to compile:
Code:

#include <sourcemod>
#include <colors>

public OnPluginStart()
{
        RegConsoleCmd("sm_discord", DiscordAd);
        RegConsoleCmd("sm_sourcebans", SourceBansAd);
}

public Action:DiscordAd(client, args)
{
        CPrintToChatAll("{yellow}Kahvitauko {yellow}>>{default} {grey}discord.me/kahvitauko);
}

public Action:SourceBansAd(client, args)
{
        CPrintToChatAll("{yellow}Kahvitauko {yellow}>>{default} {grey}Tulossa!:)");
}


farawayf 05-17-2019 12:32

Re: Having trouble with compiling
 
because its seems you dont have colors include.
Also, why are you trying to send a message to everyone? Players will flood with this.

Cruze 05-17-2019 12:35

Re: Having trouble with compiling
 
PHP Code:

#include <sourcemod>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_discord"DiscordAd);
    
RegConsoleCmd("sm_sourcebans"SourceBansAd);
}

public 
Action DiscordAd(int clientint args)
{
    
PrintToChat(client" \x10Kahvitauko >> \x04discord.me/kahvitauko\x01");
}

public 
Action SourceBansAd(int clientint args)
{
    
PrintToChat(client" \x10Kahvitauko >> \x04Tulossa!:)\x01");



francisb 05-17-2019 12:38

Re: Having trouble with compiling
 
Quote:

Originally Posted by Cruze (Post 2652025)
PHP Code:

#include <sourcemod>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_discord"DiscordAd);
    
RegConsoleCmd("sm_sourcebans"SourceBansAd);
}

public 
Action DiscordAd(int clientint args)
{
    
PrintToChat(client" \x10Kahvitauko >> \x04discord.me/kahvitauko\x01");
}

public 
Action SourceBansAd(int clientint args)
{
    
PrintToChat(client" \x10Kahvitauko >> \x04Tulossa!:)\x01");



Thanks!


All times are GMT -4. The time now is 22:03.

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