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_ss, ADMFLAG_GENERIC); RegAdminCmd("sm_ssban", Command_ssBAN, ADMFLAG_BAN); Hostname = FindConVar("hostname"); PrintToServer("----------------------------------------------------------------------------------------------------"); PrintToServer("SM_spelare och SM_steamid 'a'r startat ;)"); PrintToServer("----------------------------------------------------------------------------------------------------"); }
public Action:Command_ss(client, args) { if( args == 0 ) { PrintToChat(client, "[SM] Usage: sm_ss <#userID|name>"); return; }
decl String:arg[32]; GetCmdArg(1, arg, sizeof arg); new target = FindTarget(client, arg);
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(client, args) { if( args == 0 ) { PrintToChat(client, "[SM] Usage: sm_ssban <#userID|name>"); return; }
decl String:arg[32]; GetCmdArg(1, arg, sizeof arg); new target = FindTarget(client, arg);
if( target != -1 ) { new String:user[64]; GetClientName(target,user,sizeof(user));
new String:admin[64]; GetClientName(client,admin,sizeof(user));
decl String:TimeAndDate[64]; FormatTime(TimeAndDate, 64, NULL_STRING);
decl String:steamid[64]; GetClientAuthString(target, steamid, sizeof(steamid));
decl String:ip[20]; GetClientIP(target, ip, 20);
decl String:country[46]; GeoipCountry(ip, country, 46);
PrintToChat(target, "{green}[AsB] {default}ADMIN: %s command SnapShot on you!", admin); PrintToChat(target, "{green}[AsB] {default}Date: {green}%d {default}| Server: {blue}%s ", TimeAndDate, Hostname); PrintToChat(target, "{green}[AsB] {default}Player Name: {green}%d{default} | SteamID: {green}%s{default} | Country: {green}%c{default} | IP: {green}%i", user, steamid, country, ip ); 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.0, banclient, GetClientUserId(target)); } else { PrintToChat(client, "Failed to find target"); } }
public Action:banclient(Handle:timer, any:client) { new target = GetClientOfUserId(client); if( target > 0 ) { 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/
|