[src]/lock

Codes already submitted by people of the forums.
sokol
Loyal fan
Posts: 228
Joined: Mon May 02, 2005 7:28 pm
Location: P(r)oland

Post by sokol »

Hi, i post it but:
- dunno its work
- maybe need fix
- command -> /lock Character_nick map_name time_lock
- if dont work try fix urself or tell what is wrong i try fix it
- if got any fix/add's for this code post it there, thx

Code: Select all

if (memcmp(cp, "/lock ", 6) == 0)
    {
        char   seps[] = "= \t\n";               
        class  CStrTok * pStrTok;
        char   * token;             

        pStrTok = new CStrTok(cBuffer, seps);
        token = pStrTok->pGet();
        token = pStrTok->pGet();

        if ((pCliH->m_iAdminUserLevel & H_GM_COMMANDS) && (token != NULL))
        {
            for (int i = 0; i < DEF_MAXCLIENTS; i++)
            {
                if (m_pClientList[i] != NULL && strcmp(token, m_pClientList[i]->m_cCharName) == 0)
                {
                    int time = 0;
                    char cName[11];

                    strcpy(cName, token);
                    token = pStrTok->pGet();

                    if (token == NULL)
                    {
                        char cGMName[11];
                        if (m_pClientList[i]->m_cGMLocked != NULL) memcpy(cGMName, m_pClientList[i]->m_cGMLocked, 10);
                        else memcpy(cGMName, "Unknown", 7);

                        if (m_pClientList[i]->m_iLockedMapTime > 0)
                            wsprintf(G_cTxt, "%s is locked to %s map for %d minutes. Forced by %s.", cName, m_pClientList[i]->m_cLockedMapName, 
                                     ((m_pClientList[i]->m_iLockedMapTime+59)/60), cGMName);
                        else
                            wsprintf(G_cTxt, "%s isn't locked to any map.", cName);

                        SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, G_cTxt);
                        delete pStrTok;
                        return;
                    }
                    else
                    {
                        ZeroMemory(m_pClientList[i]->m_cLockedMapName, sizeof(m_pClientList[i]->m_cLockedMapName));

                        if (H_IsThisMapExist(token))
                        {
                            strcpy(m_pClientList[i]->m_cLockedMapName, token);
                            token = pStrTok->pGet();
                            if (token != NULL)
                                time = atoi(token)*60;
                            else time = 5 * 60;
                        }
                        else
                        {
                            time = atoi(token)*60;
                            strcpy(m_pClientList[i]->m_cLockedMapName, pCliH->m_cMapName);
                        }

                        if (time <= 0)
                        {
                            ZeroMemory(m_pClientList[i]->m_cLockedMapName, sizeof(m_pClientList[i]->m_cLockedMapName));
                            strcpy(m_pClientList[i]->m_cLockedMapName, "NONE");
                            time = 0;
                        }                        

                        m_pClientList[i]->m_iLockedMapTime = time;
                        strcpy(m_pClientList[i]->m_cGMLocked, pCliH->m_cCharName);

                        wsprintf(G_cTxt,"Character %s is locked to %s map for %d minutes.", 
                                 cName, m_pClientList[i]->m_cLockedMapName, ((time+59)/60));

                        SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, 0, 0, 0, G_cTxt);
                        SendNotifyMsg(NULL, i, DEF_NOTIFY_NOTICEMSG, 0, 0, 0, G_cTxt);

                        if (time > 0)
                        {
                            char bufor [100];
                            strcpy(bufor, m_pClientList[i]->m_cLockedMapName);
                            RequestTeleportHandler(i, "2  ", bufor);
                        }
                        delete pStrTok;
                        return;
                    }
                }
            }
            SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_PLAYERNOTONGAME, NULL, NULL, NULL, token);
        }
        else // User level
        {
            if (pCliH->m_iLockedMapTime > 0)
                wsprintf(G_cTxt,"You are locked to %s map for %d minutes.", pCliH->m_cLockedMapName, ((pCliH->m_iLockedMapTime+30)/60));
            else
                wsprintf(G_cTxt, "You aren't locked to any map.");

            SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, G_cTxt);
        }

        delete pStrTok;
        return;
    }
HatoL
Member
Posts: 151
Joined: Sun Jul 25, 2004 12:16 pm
Contact:

Post by HatoL »

nice one thanks,but what this command do? ^^
sokol
Loyal fan
Posts: 228
Joined: Mon May 02, 2005 7:28 pm
Location: P(r)oland

Post by sokol »

its a kind of punishment gm type command /lock name map time and someone cant move from location for some time what gm set :P
Daryl
Regular
Posts: 74
Joined: Thu Dec 16, 2004 1:54 am

Post by Daryl »

This is something kinda like my /mapban function that I coded here whyle back...


Basicly if some one is acting up, and BI punishment just wont work... I made a special jail map.. and from anywhere in the server i could /mapban them and lock em to that location for aset amount of time.
xmukox
Member
Posts: 175
Joined: Sun Sep 11, 2005 9:53 am

Post by xmukox »

lol nice commands but its practical? Any way thenks :D
1+12
Member
Posts: 173
Joined: Sat Feb 04, 2006 5:05 pm

Post by 1+12 »

And if that person is in another town and gets a /lock then what?
Eventually he will get eked by someone unless its a 5 player server.
Charles
Loyal fan
Posts: 418
Joined: Wed Nov 26, 2003 8:20 pm

Post by Charles »

1 wrote: And if that person is in another town and gets a /lock then what?
Eventually he will get eked by someone unless its a 5 player server.
then change the code and make it so if your a certain town you get sent to certain map...
<i>"Always write good code. Feel bad to write bad code."</i>
-apok-
Regular
Posts: 48
Joined: Sat Nov 06, 2004 1:59 am
Location: Australia

Post by -apok- »

Charles wrote:
1 wrote: And if that person is in another town and gets a /lock then what?
Eventually he will get eked by someone unless its a 5 player server.
then change the code and make it so if your a certain town you get sent to certain map...
like daryl said create a jail map as such...yet with only 4 occupiable squares or something or even one if your feeling like a real ass hole :D that will keep them occupied n give them time to think about their actions
<img src='http://i39.photobucket.com/albums/e160/ ... gycopy.png' border='0' alt='user posted image' />
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

When sent to jail, it should pick a random coord for you and para you client side and server side, deny all whispers, and anything else you can think of to isolate them to an extent. Or you could get fancy and create dynamically made maps for them so they can't even see/talk to each other :P
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
Charles
Loyal fan
Posts: 418
Joined: Wed Nov 26, 2003 8:20 pm

Post by Charles »

bone-you wrote: When sent to jail, it should pick a random coord for you and para you client side and server side, deny all whispers, and anything else you can think of to isolate them to an extent. Or you could get fancy and create dynamically made maps for them so they can't even see/talk to each other :P
remember the penalty map that was never used lol
<i>"Always write good code. Feel bad to write bad code."</i>
-apok-
Regular
Posts: 48
Joined: Sat Nov 06, 2004 1:59 am
Location: Australia

Post by -apok- »

bone-you wrote: When sent to jail, it should pick a random coord for you and para you client side and server side, deny all whispers, and anything else you can think of to isolate them to an extent. Or you could get fancy and create dynamically made maps for them so they can't even see/talk to each other :P
you would have to create a special para that wuld last the time of the ban or make a new config such as lock coords...but it is nice thou :)
<img src='http://i39.photobucket.com/albums/e160/ ... gycopy.png' border='0' alt='user posted image' />
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

-apok- wrote:
bone-you wrote: When sent to jail, it should pick a random coord for you and para you client side and server side, deny all whispers, and anything else you can think of to isolate them to an extent. Or you could get fancy and create dynamically made maps for them so they can't even see/talk to each other :P
you would have to create a special para that wuld last the time of the ban or make a new config such as lock coords...but it is nice thou :)
Nada. Just set the client para field on. Magic spells like that have to also set a timer otherwise they get stuck. :D So just set it to para and send the para message to the client and you're in perm para until you logout/leave the map. On login, if they're in that map, re-set para :P
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
-apok-
Regular
Posts: 48
Joined: Sat Nov 06, 2004 1:59 am
Location: Australia

Post by -apok- »

bone-you wrote:
-apok- wrote:
bone-you wrote: When sent to jail, it should pick a random coord for you and para you client side and server side, deny all whispers, and anything else you can think of to isolate them to an extent. Or you could get fancy and create dynamically made maps for them so they can't even see/talk to each other :P
you would have to create a special para that wuld last the time of the ban or make a new config such as lock coords...but it is nice thou :)
Nada. Just set the client para field on. Magic spells like that have to also set a timer otherwise they get stuck. :D So just set it to para and send the para message to the client and you're in perm para until you logout/leave the map. On login, if they're in that map, re-set para :P
i see...well that solves that problem :D
<img src='http://i39.photobucket.com/albums/e160/ ... gycopy.png' border='0' alt='user posted image' />
sokol
Loyal fan
Posts: 228
Joined: Mon May 02, 2005 7:28 pm
Location: P(r)oland

Post by sokol »

its easy u type /lock apok gldhall_1 100000
-apok-
Regular
Posts: 48
Joined: Sat Nov 06, 2004 1:59 am
Location: Australia

Post by -apok- »

aww lol asshole :D /kill sokol

oh n a bit of a bump there :P
<img src='http://i39.photobucket.com/albums/e160/ ... gycopy.png' border='0' alt='user posted image' />
Post Reply