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

[Error] Error in admin-tags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoldeneK
Member
Join Date: Oct 2016
Old 03-23-2017 , 17:07   [Error] Error in admin-tags
Reply With Quote #1

I have 2 errors when i try to compile:

Code:
PHP Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "GoldeneK"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>

#pragma newdecls required

EngineVersion g_Game;

public 
Plugin myinfo 
{
    
name "Server Tags [CS-NOLIMIT]"
    
author PLUGIN_AUTHOR
    
description "Server tags :P"
    
version PLUGIN_VERSION
    
url "http://alliedmods.net"
};

public 
void OnPluginStart()
{
    
g_Game GetEngineVersion();
    if (
g_Game != Engine_CSGO && g_Game != Engine_CSS)
    {
        
SetFailState("Ten plugin jest tylko na serwery CSGO i CSS. // This plugins is only for CSGO and CSS servers");
        
HookEvent("player_team"Event1);
        
HookEvent("player_spawn"Event1);
    }
}
public 
Action Event1(Handle event, const char[] namebool dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (
client)
    {
        
HandleTag(client);
    }
    return 
Plugin_Continue;
}
public 
Action HandleTag(client)
{
    if (
GetUserFlagBits(client) == ADMFLAG_CUSTOM2)
    {
        
CS_SetClientClanTag(client"< J.Admin >");
    }
    else if (
GetUserFlagBits(client) == ADMFLAG_CUSTOM3)
    {
        
CS_SetClientClanTag(client"< Admin >");
    }
    else if (
GetUserFlagBits(client) == ADMFLAG_CUSTOM4)
    {
        
CS_SetClientClanTag(client"< H.Admin >");
    }
    else if (
GetUserFlagBits(client) == ADMFLAG_ROOT)
    {
        
CS_SetClientClanTag(client"< Wlasciciel >");
    }
    else if (
GetUserFlagBits(client) == ADMFLAG_CUSTOM1)
    {
        
CS_SetClientClanTag(client"< Moderator >");
    }
    else if (
GetUserFlagBits(client) == ADMFLAG_RESERVATION)
    {
        
CS_SetClientClanTag(client"< VIP >");
    }
    else
    {
        
CS_SetClientClanTag(client"< Gracz >");
    }

Errors:
New CS Sourcepawn Script.sp(3 : error 147: new-style declarations are required
New CS Sourcepawn Script.sp(45) : error 147: new-style declarations are required
GoldeneK is offline
Weetabix
Member
Join Date: Feb 2017
Location: United Kingdom
Old 03-23-2017 , 17:28   Re: [Error] Error in admin-tags
Reply With Quote #2

PHP Code:
#pragma newdecls required 
Tells the compiler to expect the new transistional syntax.

This:
PHP Code:
new client GetClientOfUserId(GetEventInt(event"userid")); 
To this
PHP Code:
int client GetClientOfUserId(GetEventInt(event"userid")); 
This:
PHP Code:
public Action HandleTag(client
To this
PHP Code:
public Action HandleTag(int client
Also, in OnPluginStart, what are you trying to do?

Last edited by Weetabix; 03-23-2017 at 17:29.
Weetabix is offline
GoldeneK
Member
Join Date: Oct 2016
Old 03-23-2017 , 18:27   Re: [Error] Error in admin-tags
Reply With Quote #3

I'm blind, i make mistake in OnPluginStart(), thanks for help.
/close

Last edited by GoldeneK; 03-23-2017 at 18:27.
GoldeneK 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 21:47.


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