AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [USEFUL] Function list (update) (https://forums.alliedmods.net/showthread.php?t=58753)

The-Killer 08-04-2007 01:54

Re: [USEFUL] Function list
 
HOLY SHIT I love you nican!

sskillz 08-04-2007 22:03

Re: [USEFUL] Function list
 
Great work!

Nican 08-05-2007 22:25

Re: [USEFUL] Function list
 
I just re-wrote the whole inc-reader

Information should be better now...

Please, if you find any bugs report here

^BuGs^ 08-06-2007 01:26

Re: [USEFUL] Function list
 
A+!

Nican 08-09-2007 00:46

Re: [USEFUL] Function list (update)
 
UPDATE!

I added that new Code Highligher, with may help people that are starting SM and they are learning from other scripts

Fixed some bugs in the inc reader, and some other stuff...

bl4nk 08-09-2007 21:20

Re: [USEFUL] Function list (update)
 
The code highlighter is having some problems with quotes (single and double).

Nican 08-09-2007 21:29

Re: [USEFUL] Function list (update)
 
Can you show me the code you put in there?


EDIT:
Do you think I should add a comment system?

bl4nk 08-10-2007 15:49

Re: [USEFUL] Function list (update)
 
I just pasted the code from my namechanger plugin into it, so:

PHP Code:

/**
* namechanger.sp by bl4nk
* Allows an admin with the 'f' flag to change a player's name.
*
* Thanks to:
*   Extreme_One for requesting the plugin.
*   ferret for his easy-to-copy "client checker" code.
*   theY4Kman for a fix with the single quote bug.
*
* Changelog at http://forums.alliedmods.net/showthread.php?t=58825
*/

#pragma semicolon 1

#include <sourcemod>

#define PLUGIN_VERSION "1.2"

public Plugin:myinfo 
{
    
name "Name Changer",
    
author "bl4nk",
    
description "Change the name of a player",
    
version PLUGIN_VERSION,
    
url "http://forums.alliedmods.net"
};

public 
OnPluginStart()
{
    
LoadTranslations("common.phrases");
    
LoadTranslations("namechanger.phrases");
    
    
CreateConVar("sm_namechanger_version"PLUGIN_VERSION"Name Changer Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
RegAdminCmd("sm_name"Command_NameADMFLAG_SLAY"sm_name <user> <name>");
}

public 
Action:Command_Name(clientargs)
{

    if (
args 2)
    {
        
ReplyToCommand(client"[SM] Usage: sm_name <user> <name>");
        return 
Plugin_Handled;
    }

    new 
String:target[64];
    
GetCmdArg(1targetsizeof(target));

    new 
String:name[64];
    
GetCmdArg(2namesizeof(name));

    
ReplaceString(namesizeof(name), " ' ""'");

    new 
clients[2];
    new 
numClients SearchForClients(targetclients2);
    
    if (
numClients == 0)
    {
        
ReplyToCommand(client"[SM] %t""No matching client");
        return 
Plugin_Handled;
    }
    else if (
numClients 1)
    {
        
ReplyToCommand(client"[SM] %t""More than one client matches");
        return 
Plugin_Handled;
    }
    else if (!
CanUserTarget(clientclients[0]))
    {
        
ReplyToCommand(client"[SM] %t""Unable to target");
        return 
Plugin_Handled;
    }
    else if (
IsFakeClient(clients[0]))
    {
        
ReplyToCommand(client"[SM] %t""Cannot target bot");
        return 
Plugin_Handled;
    }

    new 
player clients[0];

    
PrintToChat(player"[SM] %t""Name Changed");
    
ClientCommand(player"name \"%s\""name);

    return 
Plugin_Handled;



Nican 08-10-2007 16:34

Re: [USEFUL] Function list (update)
 
Hmm... Funny
Fixed...

The code worked perfectly on my home server...

Well, sorry for the mix up, now it is fixed...

pRED* 08-10-2007 17:54

Re: [USEFUL] Function list (update)
 
Wow that's crazily awesome. Code highlighter rocks. <3


All times are GMT -4. The time now is 18:49.

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