AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved RockTheVote "R4.2" (https://forums.alliedmods.net/showthread.php?t=331682)

nflcsinfo 04-01-2021 14:29

RockTheVote "R4.2"
 
Can you tell me why he gives me this mistake at any time? The error I get is from: colorchat However, I removed it and it says again that there is an error and I do not know exactly what is happening

Here is the code:
HTML Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <chatcolor>


#define PREFIX "^1 [^4 Zombie Plague^1 ]"

new rtv[33], count;
new min_players, max_players, howmanyvotesperc, timevote, directmapchange, vote_delay, bool:ChangeMap = false, nextmap[64]

public plugin_init()
{
        register_plugin("RockTheVote", "R4.2", "HarveyWNvm");
       
        register_clcmd("say", "cmdSay");
        register_clcmd("say_team",        "cmdSay");

        min_players = register_cvar("amx_min_players", "4"); // how many votes the plugin needs in order to start the vote (below this it will take the count of the players)
        max_players = register_cvar("amx_max_players", "8"); // how many players the plugin needs in order to start working with howmanyvotesperc
        howmanyvotesperc = register_cvar("amx_howmanypercentage", "0.50"); // how much percent of the players need to vote in order to start the vote
        timevote = register_cvar("amx_timevote", "5"); // how much time players need to wait before the plugin is active
        directmapchange = register_cvar( "amx_directmapchange", "0" ); // 0 = map changes on roundstart || 1 = map changes after xx seconds(vote_delay)
        vote_delay = register_cvar("amx_voteDelay", "20"); // don't write less than 20, because the map will change before the vote is over
       
        register_logevent ( "RoundStart", 2, "1=Round_Start" );
}

public  client_disconnect(id)
{
        if (rtv[id-1] == id)
        {
                rtv[id-1] = 0;
                count--;
        }
}

public cmdSay(id)
{
        new szMessage[32]
        read_args(szMessage, charsmax(szMessage));
        remove_quotes(szMessage);
        if        ((equali(szMessage, "rtv") == 1) || (equali(szMessage, "/rtv") == 1))
        {
                if (get_gametime() < (get_pcvar_float(timevote) * 60.0))
                        ColorChat(id, TEAM_COLOR, "%s Vote is currently not allowed. Wait ^4%d^1 minutes.", PREFIX, (floatround(((get_pcvar_float(timevote) * 60.0) - get_gametime()) / 60.0)))
                else
                {
                        if        (rtv[id-1] == id)
                                ColorChat(id, TEAM_COLOR, "%s You have already voted!",PREFIX);
                        else
                        {
                                rtv[id-1] = id;
                                count++;
                               
                                static name[32];
                                get_user_name( id, name, charsmax( name ) );
                               

                                new playerNum = get_playersnum();
                                new minPlayers = get_pcvar_num(min_players)
                                new maxPlayers = get_pcvar_num(max_players)
                                new minPlayersPercent = floatround((get_pcvar_float(howmanyvotesperc) * playerNum))
                               
                                if(playerNum <= minPlayers) {
                                        if (count == playerNum || playerNum-count <= 0) {
                                                StartVoteMap()
                                                return PLUGIN_HANDLED;
                                        }
                                        ColorChat(0, TEAM_COLOR, "%s Player ^4%s^1 vote was added. Need ^4%d^1 more votes to start voting!",PREFIX, name, playerNum-count)
                                }
                               
                                if (playerNum >
minPlayers && playerNum < maxPlayers) {
                                        if (count == minPlayers || minPlayers-count <= 0) {
                                                StartVoteMap()
                                                return PLUGIN_HANDLED;
                                        }
                                        ColorChat(0, TEAM_COLOR, "%s Player ^4%s^1 vote was added. Need ^4%d^1 more votes to start voting!",PREFIX, name, minPlayers-count)
                                }
                                if(playerNum >
= maxPlayers) {
                                        if (count == minPlayersPercent || minPlayersPercent-count <= 0) {
                                                StartVoteMap()
                                                return PLUGIN_HANDLED;
                                        }
                                        ColorChat(0, TEAM_COLOR, "%s Player ^4%s^1 vote was added. Need ^4%d^1 more votes to start voting!",PREFIX, name, minPlayersPercent-count)
                                }
                        }
                }
        }
        return PLUGIN_CONTINUE;
}
public StartVoteMap() {
        ChangeMap = true
       
        if (get_pcvar_num(directmapchange)) {
                new delay = max(get_pcvar_num(vote_delay),20)
                set_hudmessage(210, 0, 0, 0.02, 0.43, 1, 20.0, 10.0, 0.5, 0.15, 4);
                show_hudmessage(0, "The map will change in %d seconds", delay);
                set_task(float(delay),"RoundStart")
        } else {
                set_hudmessage(210, 0, 0, 0.02, 0.43, 1, 20.0, 10.0, 0.5, 0.15, 4);
                show_hudmessage(0, "This is the final round");
        }
       
        if(find_plugin_byfile("mapchooser.amxx") != INVALID_PLUGIN_ID)
        {
                new oldWinLimit = get_cvar_num("mp_winlimit"), oldMaxRounds = get_cvar_num("mp_maxrounds");
                set_cvar_num("mp_winlimit",0);
                set_cvar_num("mp_maxrounds",-1);
               
                if(callfunc_begin("voteNextmap","mapchooser.amxx") == 1)
                        callfunc_end();

                set_cvar_num("mp_winlimit",oldWinLimit);
                set_cvar_num("mp_maxrounds",oldMaxRounds);
                return PLUGIN_CONTINUE;
        }
        return PLUGIN_HANDLED;
}

public RoundStart()
{
        if (ChangeMap == true)
        {
                get_cvar_string("amx_nextmap", nextmap, charsmax(nextmap));
                server_cmd( "changelevel %s", nextmap );
        }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1251\\ deff0\\ deflang1026{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/



Fix error code:

HTML Code:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/tmp/texth5Quz1.sma(5) : fatal error 100: cannot read from file: "colorchat"

Compilation aborted.
1 Error.
Done.


OciXCrom 04-01-2021 16:39

Re: RockTheVote "R4.2"
 
The compile log you attached has nothing to do with that plugin.

nflcsinfo 04-02-2021 04:14

Re: RockTheVote "R4.2"
 
It doesn't work for me and I don't know why.

fysiks 04-02-2021 16:37

Re: RockTheVote "R4.2"
 
As Oxi said, the code that you posted did not produce that compile error. You need to post the actual code that you're trying to compile.

nflcsinfo 04-04-2021 06:56

Re: RockTheVote "R4.2"
 
I just put everything and gave the mistakes that make me wrong. No way to help me with this little thing?

fysiks 04-04-2021 13:36

Re: RockTheVote "R4.2"
 
It's like you saying "can you fix my car?" and then you bring in your somebody else's car. How can they fix your car if you being an entirely different car into the shop?

nflcsinfo 04-05-2021 06:44

Re: RockTheVote "R4.2"
 
I don't understand cars

fysiks 04-05-2021 12:52

Re: RockTheVote "R4.2"
 
Quote:

Originally Posted by nflcsinfo (Post 2743094)
I don't understand cars

That's not relevant. Replace "car" with literally anything else in my analogy.

nflcsinfo 04-08-2021 08:25

Re: RockTheVote "R4.2"
 
I understand very well. And I answer your question? I just want to know if there will be a way for the plugin?

SHIFT0 04-08-2021 09:42

Re: RockTheVote "R4.2"
 
OciXCrom


All times are GMT -4. The time now is 19:55.

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