Raised This Month: $51 Target: $400
 12% 

Can someone fix this code ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snake.
Senior Member
Join Date: Jul 2017
Old 09-22-2018 , 04:34   Can someone fix this code ?
Reply With Quote #1

Code:
#include <amxmodx>


#pragma semicolon 1
#pragma ctrlchar '\'

new bool:boostx[33];

public plugin_init()
{
    register_plugin("Boost", "1.0", "Morak");
    register_clcmd("say /boost", "boost", -1, "", -1);
    return 0;
}

public boost(id)
{
    //!!! Removed Phi
    if (get_user_flags(id, 0) & 8)
    {
        if (boostx[id])
        {
            boostx[id] = 0;
            set_cvar_string("hns_semiclip", "1");
            set_cvar_string("hns_noboosting", "1");
            set_cvar_string("hns_hidetime", "10");
            set_cvar_string("mp_limitteams", "0");
            set_cvar_string("mp_autoteambalance", "1");
            set_cvar_string("mp_roundtime", "2");
            set_cvar_string("sv_alltalk", "1");
            set_cvar_string("sv_voiceenable", "1");
            set_cvar_string("mp_timelimit", "40");
            set_cvar_string("mp_forcecamera", "0");
            set_cvar_string("sv_restart", "1");
            client_print(0, print_chat, "[GeneraL] Boost Kapatildi");
        }
        boostx[id] = 1;
        set_cvar_string("mp_roundtime", "9");
        set_cvar_string("mp_timelimit", "0");
        set_cvar_string("hns_semiclip", "0");
        set_cvar_string("hns_noboosting", "0");
        set_cvar_string("hns_hidetime", "20");
        set_cvar_string("mp_limitteams", "1");
        set_cvar_string("mp_autoteambalance", "1");
        set_cvar_string("sv_alltalk", "0");
        set_cvar_string("sv_voiceenable", "1");
        set_cvar_string("mp_forcecamera", "1");
        set_cvar_string("sv_restart", "1");
        new i = 0;
        while (i <= 33)
        {
            if (is_user_connected(i))
            {
                new var1 = Heap_4;
                var1[0] = 1100;
                if (get_user_team(i, var1, 0) != 1)
                {
                    cs_set_user_team(id, 1, _}:0);
                    i++;
                }
                i++;
            }
            i++;
        }
        client_print(0, print_chat, "[GeneraL] Boost Acildi");
    }
    return 0;
}

Last edited by Snake.; 09-22-2018 at 04:36.
Snake. is offline
Send a message via Skype™ to Snake.
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-22-2018 , 04:36   Re: Can someone fix this code ?
Reply With Quote #2

What even is this code
__________________
edon1337 is offline
Snake.
Senior Member
Join Date: Jul 2017
Old 09-22-2018 , 04:48   Re: Can someone fix this code ?
Reply With Quote #3

Plugin that changes some cvars only.

Last edited by Snake.; 09-22-2018 at 04:48.
Snake. is offline
Send a message via Skype™ to Snake.
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-22-2018 , 05:47   Re: Can someone fix this code ?
Reply With Quote #4

1) What is the problem?
2) Instead of writing get_user_flags(id) & 8 write get_user_flags(id) & ADMIN_BAN, it's way better in the aspect of readability.
3) Why are you using a while() loop to loop through all players? Simply use get_players and a for() loop.
__________________
edon1337 is offline
Snake.
Senior Member
Join Date: Jul 2017
Old 09-22-2018 , 06:19   Re: Can someone fix this code ?
Reply With Quote #5

Quote:
Originally Posted by edon1337 View Post
1) What is the problem?
2) Instead of writing get_user_flags(id) & 8 write get_user_flags(id) & ADMIN_BAN, it's way better in the aspect of readability.
3) Why are you using a while() loop to loop through all players? Simply use get_players and a for() loop.
Bro, i did not make this stuff. I converted it to sma from amxx. Can you simply make a stuff that releated to this ? When an admin say /boost, some cvars will change, if admin type again /boost, some cvars will change again.
Snake. is offline
Send a message via Skype™ to Snake.
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 09-22-2018 , 07:05   Re: Can someone fix this code ?
Reply With Quote #6

Quote:
Originally Posted by Snake. View Post
Bro, i did not make this stuff. I converted it to sma from amxx. Can you simply make a stuff that releated to this ? When an admin say /boost, some cvars will change, if admin type again /boost, some cvars will change again.
Oh man.. This is one of the most uninformative posts I've seen.
If you're expecting to get some help please explain what you need when you create your post, without someone having to ask you.
Also I haven't tried decompiling an amxx file but I don't think that's what you would get.

Anyway I'm assuming you want an admin command which changes these cvars and when the bool is set to false, transfer all CTs to T ???

This should do just that:

Spoiler
__________________
Rohanlogs is offline
Snake.
Senior Member
Join Date: Jul 2017
Old 09-22-2018 , 07:24   Re: Can someone fix this code ?
Reply With Quote #7

Quote:
Originally Posted by Rohanlogs View Post
Oh man.. This is one of the most uninformative posts I've seen.
If you're expecting to get some help please explain what you need when you create your post, without someone having to ask you.
Also I haven't tried decompiling an amxx file but I don't think that's what you would get.

Anyway I'm assuming you want an admin command which changes these cvars and when the bool is set to false, transfer all CTs to T ???

This should do just that:

Spoiler
Thank you dude! I had a request again. I want to stop some plugins when boost typed. How can i do it ?
Snake. is offline
Send a message via Skype™ to Snake.
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 09-22-2018 , 07:31   Re: Can someone fix this code ?
Reply With Quote #8

Quote:
Originally Posted by Snake. View Post
Thank you dude! I had a request again. I want to stop some plugins when boost typed. How can i do it ?
This?

PHP Code:
server_cmd("^"amx_pausecfg pause plugin_name.amxx^""); 
And to enable:

PHP Code:
server_cmd("^"amx_pausecfg enable plugin_name.amxx^""); 
__________________
Rohanlogs is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-22-2018 , 07:51   Re: Can someone fix this code ?
Reply With Quote #9

Quote:
Originally Posted by Rohanlogs View Post
This?

PHP Code:
server_cmd("^"amx_pausecfg pause plugin_name.amxx^""); 
And to enable:

PHP Code:
server_cmd("^"amx_pausecfg enable plugin_name.amxx^""); 
https://www.amxx-bg.info/api/amxmodx/pause ?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Snake.
Senior Member
Join Date: Jul 2017
Old 09-22-2018 , 07:55   Re: Can someone fix this code ?
Reply With Quote #10

Quote:
Originally Posted by Rohanlogs View Post
This?

PHP Code:
server_cmd("^"amx_pausecfg pause plugin_name.amxx^""); 
And to enable:

PHP Code:
server_cmd("^"amx_pausecfg enable plugin_name.amxx^""); 
Bro, did not work. Can you add it into the code ? Maybe it might be my mistake

Last edited by Snake.; 09-22-2018 at 07:55.
Snake. is offline
Send a message via Skype™ to Snake.
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 00:34.


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