Raised This Month: $ Target: $400
 0% 

[CSS] Can't rewrite some string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BHy4ok
Junior Member
Join Date: Jul 2006
Location: Russia Federation
Old 03-16-2009 , 01:31   Re: [CSS] Can't rewrite some string
Reply With Quote #1

PHP Code:
/*    AMXModX plugin
*     (c) 2009 made by L3X.
*
*    ICQ: 8721378
*
*commands:
*    sm_checkpass  - check or not password from players (default 1)
*    sm_setpass  - sets the server password
*    sm_showpass  - Shows the established password
*    sm_onshow  - show or not password to admin's (default 1)
*
*
*/

#include <sourcemod>

#define ACCESS_FLAG        ADMFLAG_KICK

new Handle:Cvar_OnShow INVALID_HANDLE;
new 
Handle:Cvar_CheckPass INVALID_HANDLE;

public 
Plugin:myinfo 
{
    
name "Server password",
    
author "L3X",
    
description "none"
};

new 
szPass[40];


public 
OnPluginStart()
{
    
RegAdminCmd("sm_setpass"Command_SetPassACCESS_FLAG"sm_setpass [password]");
    
RegAdminCmd("sm_showpass"Command_ShowPassACCESS_FLAG);
    
Cvar_CheckPass CreateConVar("sm_checkpass","1");
    
Cvar_OnShow CreateConVar("sm_onshow","1");
    
CreateTimer(20.0OnSetDefMap0TIMER_REPEAT);
}

public 
OnClientPostAdminCheck(client)
{
    if(!
GetConVarInt(Cvar_CheckPass)) 
        return 
Plugin_Handled;              
    if(
GetUserFlagBits(client) & ACCESS_FLAG)
        return 
Plugin_Handled;
    if(
IsFakeClient(client))
        return 
Plugin_Handled;

    if((
GetClientCount(false)) || (StrEqual(szPass"")))
        
KickClient(client"Only players with admin's rights allowed now"GetClientUserId(client)); 
    else    

    {    
    new 
user_pass[sizeof(szPass)];
    
GetClientInfo(client"_cw"user_passsizeof(user_pass));
    
    if (!
StrEqual(szPassuser_pass))
    {
        
KickClient(client"Kicked: You entered wrong password (setinfo _cw '***')"GetClientUserId(client));
    }

    }
    return 
Plugin_Continue;

}


public 
Action:Command_SetPass(clientargs)
{
    if(!
CheckCommandAccess(client"sm_setpass"ACCESS_FLAG))
        return 
Plugin_Handled;

    if (
args 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_setpass [password]");
        return 
Plugin_Handled;
    }

    
GetCmdArgString(szPass39);
    
PrintToChat(client"The password on server is established");

    return 
Plugin_Handled;    
}

public 
Action:Command_ShowPass(clientargs)
{
    if(!
GetConVarInt(Cvar_OnShow))
    {
        
PrintToConsole(client"The given function is switched off");
        return 
Plugin_Handled;
    }
    if(
GetUserFlagBits(client) & ACCESS_FLAG)
        
PrintToConsole(client"Server Password is: %s"szPass);
    return 
Plugin_Handled;
}

public 
Action:OnSetDefMap(Handle:timer)
{
    if(!
GetConVarInt(Cvar_CheckPass))
        return 
Plugin_Handled;

    if((
GetClientCount(true)==0) & (!StrEqual(szPass"")))
        
szPass="";

    new 
mapname[32];
    
GetCurrentMap(mapname31);

    if((
GetClientCount(true)==0) & (!StrEqual("de_dust",mapname)))
        
ServerCommand("map de_dust");
    return 
Plugin_Handled;
        

How to correct a mistake "warning 213: tag mismatch"(In 44,46,48,50,56,58,64,80,102,103 lines). 15 Warnings...
I can't understand.
__________________
< L3X.

Last edited by BHy4ok; 03-16-2009 at 03:40.
BHy4ok is offline
Send a message via ICQ to BHy4ok
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 03:08.


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