AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Your_Name_Here.justgotowned.com (https://forums.alliedmods.net/showthread.php?t=27117)

Sonic ;) 04-15-2006 00:12

Your_Name_Here.justgotowned.com
 
Today I found this site called Aninote.com which has a few sites like justgotowned.com where all you have to do is put a person's name in front of the address (ex. Your_Name_Here.justgotowned.com) and then it displays a slide show with that persons name showing people getting owned. It's very funny :lol: (except for the kid in the wood chipper, very sad :cry: ). Well what I'd like to do is have an admin only command that you can enable so that when you headshot somebody it shows that person a MOTD window that displays that site with their name. Not all names work for this site though. You can't have spaces or odd characters (ex. []\| etc.) so it in this plugin, it would be cool if it could modify the name to remove spaces and odd characters. Do you think this can be done?

Xanimos 04-15-2006 00:19

Pretty simply.

Sonic ;) 04-20-2006 18:53

Can somebody make this plugin for me?

Xanimos 04-20-2006 19:13

I don't know if it will show properly (The MOTD might cause errors when trying to load flash)

But if that works this should work fine (wasn't tested just compiled)

[EDIT] Don't mind the way its colored the coloring fucks up when it doesn't know that the ^ is the espcape character.

Use the one in green...

Code:
#include <amxmodx> #include <amxmisc> #define MAX_BAD 21 new szBad[MAX_BAD][2] = {     "%",     "^^",     "#",     "@",     "\",     "/",     "*",     "&",     "^"",     "'",     ";",     ":",     "<",     ">",     "|",     "?",     "=",     ",",     "!",     "(",     ")" }; public plugin_init() {     register_plugin("Ownage" , "1.0" , "Suicid3");     register_concmd("amx_own" , "cmdOwn" , ADMIN_KICK , " <Player> -- Shows player Ownage MOTD"); } public cmdOwn(id , level , cid) {     if(!cmd_access(id , level , cid , 2))         return PLUGIN_HANDLED;     new szMotd[256] , szName[36] , tID , szArg[36];     read_argv(1 , szArg , 35);     tID = cmd_target( id , szArg , 11);     if(!is_user_connected(tID))         return PLUGIN_HANDLED;     get_user_safe_name(tID , szName , 35);     format(szMotd , 255 , "<html><head></head><body><iframe width=^"100%^" height=^"100%^" src=^"http://%s.justgotowned.com/^"></iframe></body></html>" , szName);     show_motd(tID , szMotd , "You just got Owned!");     console_print(id , "[AMXX] %s Just got Owned!" , szName);     return PLUGIN_HANDLED; } stock get_user_safe_name( id , szName[] , iLen ) {     get_user_name( id , szName , iLen );     for(new i = 0 ; i < MAX_BAD; i++)         replace_all( szName , iLen , szBad[i] , ""); }

Code:

#include <amxmodx>
#include <amxmisc>

#define MAX_BAD        21

new szBad[MAX_BAD][2] = {
        "%",
        "^^",
        "#",
        "@",
        "\",
        "/",
        "*",
        "&",
        "^"",
        "'",
        ";",
        ":",
        "<",
        ">",
        "|",
        "?",
        "=",
        ",",
        "!",
        "(",
        ")"
};

public plugin_init()
{
        register_plugin("Ownage" , "1.0" , "Suicid3");
        register_concmd("amx_own" , "cmdOwn" , ADMIN_KICK , " <Player> -- Shows player Ownage MOTD");
}

public cmdOwn(id , level , cid)
{
        if(!cmd_access(id , level , cid , 2))
                return PLUGIN_HANDLED;

        new szMotd[256] , szName[36] , tID , szArg[36];
        read_argv(1 , szArg , 35);
        tID = cmd_target( id , szArg , 11);
        if(!is_user_connected(tID))
                return PLUGIN_HANDLED;

        get_user_safe_name(tID , szName , 35);
        format(szMotd , 255 , "<html><head></head><body><iframe width=^"100%^" height=^"100%^" src=^"http://%s.justgotowned.com/^"></iframe></body></html>" , szName);
        show_motd(tID , szMotd , "You just got Owned!");

        console_print(id , "[AMXX] %s Just got Owned!" , szName);

        return PLUGIN_HANDLED;
}

stock get_user_safe_name( id , szName[] , iLen )
{
        get_user_name( id , szName , iLen );

        for(new i = 0 ; i < MAX_BAD; i++)
                replace_all( szName , iLen , szBad[i] , "");
}


v3x 04-20-2006 22:47

Code:
    "^"",

Xanimos 04-20-2006 22:57

it screws up when using ^^ inside quotes.

Code:
"^^", "^""

Sonic ;) 04-21-2006 05:02

Thanks, I'm gonna test it right now.

Sonic ;) 04-21-2006 05:26

When I went to compile it I got this error:

//// ugotowned.sma
// C:\dedicated server\cstrike\addons\amxmodx\scripting\ugoto wned.sma(61) : error 017: undefined symbol "replace_all"
//
// 1 Error.
// Could not Locate output file compiled\ugotowned.amx (compile failed).
//
// Compilation Time: 0.75 sec
//------------------------------------------------------

FatalisDK 04-21-2006 06:47

Your AMXx version is probably < 1.65. Upgrade to latest version.

Sonic ;) 04-29-2006 19:45

OK I managed to get it compiled. I did the amx_own command on myself and everything worked except when it tried to load the web site it said bad request.


All times are GMT -4. The time now is 07:15.

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