AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   many errors on plugin (https://forums.alliedmods.net/showthread.php?t=156616)

ecca 05-09-2011 12:55

many errors on plugin
 
Well. Im working on my first "advanced" plugin and i get many errors

PHP Code:

#include <colors>
#include <sourcemod>
#include <geoip>

#define PLUGIN_VERSION "1.0"

new Handle:Hostname;

public 
Plugin:myinfo =
{
    
name "Advanced snapshot ban",
    
author "ecca",
    
description "",
    
version PLUGIN_VERSION,
    
url "http://www.csgaming.se"
};

public 
OnPluginStart()
{
    
RegAdminCmd("sm_ss"Command_ssADMFLAG_GENERIC);
    
RegAdminCmd("sm_ssban"Command_ssBANADMFLAG_BAN);
    
Hostname FindConVar("hostname");
    
PrintToServer("----------------------------------------------------------------------------------------------------");
    
PrintToServer("SM_spelare och SM_steamid 'a'r startat ;)");
    
PrintToServer("----------------------------------------------------------------------------------------------------");
}

public 
Action:Command_ss(clientargs)
{
    new 
target FindTarget(clientargs);
    
    new 
String:user[64];
    
GetClientName(target,user,sizeof(user));
    
    new 
String:admin[64];
    
GetClientName(client,admin,sizeof(user));
    
    
PrintToChat(target"{green}[AsB] {default}ADMIN: %s command SnapShot on you!"admin);
    
PrintToChatAll("{green}[AsB]{default}: An {green}administrator{default} took a snapshot on {teamcolor}%s"target);
    
ClientCommand("jpeg");
}

public 
Action:Command_ssBAN(clientargs)
{    
    new 
target FindTarget(clientargs);

    new 
String:user[64];
    
GetClientName(target,user,sizeof(user));
    
    new 
String:admin[64];
    
GetClientName(client,admin,sizeof(user));
    
    
decl String:TimeAndDate[64];
    
FormatTime(TimeAndDate64NULL_STRING);
    
    
decl String:steamid[64];
    
GetClientAuthString(targetsteamidsizeof(steamid));
    
    
decl String:ip[20];
    
GetClientIP(targetip20);
    
    
decl String:country[46];
    
GeoipCountry(targetcountry46);
    
    
    
PrintToChat(target"{green}[AsB] {default}ADMIN: %s command SnapShot on you!"admin);
    
PrintToChat(target"{green}[AsB] {default}Date: {green}%d {default}| Server: {blue}%s "TimeAndDateHostname);
    
PrintToChat(target"{green}[AsB] {default}Player Name: {green}%d{default} | SteamID: {green}%s{default} | Country: {green}%c{default} | IP: {green}%i"usersteamidcountryip );
    
PrintToChat(target"{green}[AsB] {default}For unban upload your pictures on {blue}www.csgaming.se");
    
PrintToChatAll("{green}[AsB]{default}: An {green}administrator{default} took a snapshot on {teamcolor}%s"target);
    
ClientCommand("jpeg");
    
CreateTimer(5.0banclient);
}

public 
Action:banclient(clientHandle:timer)
{
    new 
target FindTarget(client);
    
    new 
String:user[64];
    
GetClientName(target,user,sizeof(user));
    
    
ServerCommand("sm_ban %s 0 [AsB] Admin suspect that you cheat, upload pictures on website"target);


ERRORS

Silvers 05-09-2011 13:12

Re: many errors on plugin
 
Something like:

PHP Code:

#include <colors>
#include <sourcemod>
#include <geoip>

#define PLUGIN_VERSION "1.0"

new Handle:Hostname;

public 
Plugin:myinfo =
{
    
name "Advanced snapshot ban",
    
author "ecca",
    
description "",
    
version PLUGIN_VERSION,
    
url "http://www.csgaming.se"
};

public 
OnPluginStart()
{
    
RegAdminCmd("sm_ss"Command_ssADMFLAG_GENERIC);
    
RegAdminCmd("sm_ssban"Command_ssBANADMFLAG_BAN);
    
Hostname FindConVar("hostname");
    
PrintToServer("----------------------------------------------------------------------------------------------------");
    
PrintToServer("SM_spelare och SM_steamid 'a'r startat ;)");
    
PrintToServer("----------------------------------------------------------------------------------------------------");
}

public 
Action:Command_ss(clientargs)
{
    if( 
args == )
    {
        
PrintToChat(client"[SM] Usage: sm_ss <#userID|name>");
        return;
    }

    
decl String:arg[32];
    
GetCmdArg(1argsizeof arg);
    new 
target FindTarget(clientarg);

    new 
String:user[64];
    
GetClientName(target,user,sizeof(user));

    new 
String:admin[64];
    
GetClientName(client,admin,sizeof(user));

    
PrintToChat(target"{green}[AsB] {default}ADMIN: %s command SnapShot on you!"admin);
    
PrintToChatAll("{green}[AsB]{default}: An {green}administrator{default} took a snapshot on {teamcolor}%s"target);
    
ClientCommand(target"jpeg");
}

public 
Action:Command_ssBAN(clientargs)
{
    if( 
args == )
    {
        
PrintToChat(client"[SM] Usage: sm_ssban <#userID|name>");
        return;
    }

    
decl String:arg[32];
    
GetCmdArg(1argsizeof arg);
    new 
target FindTarget(clientarg);

    if( 
target != -)
    {
        new 
String:user[64];
        
GetClientName(target,user,sizeof(user));

        new 
String:admin[64];
        
GetClientName(client,admin,sizeof(user));

        
decl String:TimeAndDate[64];
        
FormatTime(TimeAndDate64NULL_STRING);

        
decl String:steamid[64];
        
GetClientAuthString(targetsteamidsizeof(steamid));

        
decl String:ip[20];
        
GetClientIP(targetip20);

        
decl String:country[46];
        
GeoipCountry(ipcountry46);

        
PrintToChat(target"{green}[AsB] {default}ADMIN: %s command SnapShot on you!"admin);
        
PrintToChat(target"{green}[AsB] {default}Date: {green}%d {default}| Server: {blue}%s "TimeAndDateHostname);
        
PrintToChat(target"{green}[AsB] {default}Player Name: {green}%d{default} | SteamID: {green}%s{default} | Country: {green}%c{default} | IP: {green}%i"usersteamidcountryip );
        
PrintToChat(target"{green}[AsB] {default}For unban upload your pictures on {blue}www.csgaming.se");
        
PrintToChatAll("{green}[AsB]{default}: An {green}administrator{default} took a snapshot on {teamcolor}%s"target);
        
ClientCommand(target"jpeg");
        
CreateTimer(5.0banclientGetClientUserId(target));
    }
    else
    {
        
PrintToChat(client"Failed to find target");
    }
}

public 
Action:banclient(Handle:timerany:client)
{
    new 
target GetClientOfUserId(client);
    if( 
target )
    {
        new 
String:user[64];
        
GetClientName(target,user,sizeof(user));

        
ServerCommand("sm_ban %s 0 [AsB] Admin suspect that you cheat, upload pictures on website"target);
    }



I would recommend reading the wiki about the functions which produced a tag mismatch etc. You were using them wrong. http://docs.sourcemod.net/api/

ecca 05-09-2011 13:15

Re: many errors on plugin
 
Wow thanks dude you solved almost all the errors

only 1 left.

error 030: compund statement not closed at the end of file <started at line 99>

Silvers 05-09-2011 13:26

Re: many errors on plugin
 
Uhm? I dont get that...

ecca 05-09-2011 13:30

Re: many errors on plugin
 
Now it worked, thnx

ecca 05-09-2011 13:55

Re: many errors on plugin
 
Well, im getting this

FCVAR_SERVER_CAN_EXECUTE prevented server running command: jpeg

how can i force i client to use the command jpeg

psychonic 05-09-2011 14:02

Re: many errors on plugin
 
Quote:

Originally Posted by ecca (Post 1466319)
Well, im getting this

FCVAR_SERVER_CAN_EXECUTE prevented server running command: jpeg

how can i force i client to use the command jpeg

The server cannot force the client to take a screenshot.

ecca 05-09-2011 14:04

Re: many errors on plugin
 
Damn what i hate Counter strike:source

berni 05-09-2011 14:48

Re: many errors on plugin
 
I also hate it, I wasn't able to format the client's harddisk.

ecca 05-09-2011 15:56

Re: many errors on plugin
 
-.- in 1.6 you can do everything you want almost with your players. Whatever lock the thread and thanks for the help


All times are GMT -4. The time now is 12:36.

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