Raised This Month: $32 Target: $400
 8% 

many errors on plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ecca
Sexy Santa
Join Date: Jan 2011
Old 05-09-2011 , 12:55   many errors on plugin
Reply With Quote #1

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

Last edited by ecca; 05-15-2011 at 13:51.
ecca is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-09-2011 , 13:12   Re: many errors on plugin
Reply With Quote #2

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/
__________________
Silvers is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 05-09-2011 , 13:15   Re: many errors on plugin
Reply With Quote #3

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>
ecca is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-09-2011 , 13:26   Re: many errors on plugin
Reply With Quote #4

Uhm? I dont get that...
__________________
Silvers is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 05-09-2011 , 13:30   Re: many errors on plugin
Reply With Quote #5

Now it worked, thnx
ecca is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 05-09-2011 , 13:55   Re: many errors on plugin
Reply With Quote #6

Well, im getting this

FCVAR_SERVER_CAN_EXECUTE prevented server running command: jpeg

how can i force i client to use the command jpeg
ecca is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-09-2011 , 14:02   Re: many errors on plugin
Reply With Quote #7

Quote:
Originally Posted by ecca View Post
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.
psychonic is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 05-09-2011 , 14:04   Re: many errors on plugin
Reply With Quote #8

Damn what i hate Counter strike:source
ecca is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 05-09-2011 , 14:48   Re: many errors on plugin
Reply With Quote #9

I also hate it, I wasn't able to format the client's harddisk.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 05-09-2011 , 15:56   Re: many errors on plugin
Reply With Quote #10

-.- in 1.6 you can do everything you want almost with your players. Whatever lock the thread and thanks for the help
ecca is offline
Reply


Thread Tools
Display Modes

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 02:42.


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