Hallo zusammen kann mir das jemand so scripten das es sich wieder compilieren lässt. Wäre super da ich das gern nutzen würde und leider nicht scripten kann....
[Code]
/********************************************* *******************************************
* Copyright (C) 2005 Rains *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
********************************************* *******************************************/
#include <amxmodx>
#include <fun>
new vote
new votes
new players[32]
new knife_rounds
new knife_cooldown
new show[6]
#define CHANNEL 4
public plugin_init() {
register_plugin("Vote Knife Plugin", "1.0", "Rains")
register_cvar("amx_vote_knife","1") // Turns plugin on
register_cvar("amx_vote_knife_time","20.0") // How long time people can vote
register_cvar("amx_vote_knife_ratio","0.5") // How many votes needed for knife only
register_cvar("amx_vote_knife_rounds","3") // How many rounds it will be knife only
register_cvar("amx_vote_knife_hud","1") // Set hudmessage on/off
register_cvar("amx_vote_knife_cooldown","3") // How many rounds it will wait between knife only and next vote
if (get_cvar_num("amx_vote_knife") == 1)
{
register_event("ResetHUD", "hook_hud", "be")
register_event("CurWeapon", "cur_weapon", "be", "2!29")
register_clcmd("say /knife", "knife_vote")
}
}
public hook_hud(id)
{
if (knife_rounds > 0)
vote = 0
else if (knife_cooldown > 0)
{
vote = 2
knife_cooldown = knife_cooldown - 1
}
else
vote = 1
if (vote == 0)
{
if (get_cvar_num("amx_vote_knife_hud") == 1)
{
set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 5.0, 0.1, 0.2, CHANNEL)
show_hudmessage(id, "Knife only for %i more rounds!", knife_rounds)
}
if (show[0] == 0)
client_print(0,print_chat,"[Knife] Es gibt jetzt %i Messer Runden", knife_rounds)
show[0] = 1
if (show[5] == 0)
knife_rounds = knife_rounds - 1
show[5] = 1
set_task(5.0, "reset_show")
cur_weapon(id)
}
else if (vote == 1)
{
set_task(get_cvar_float("amx_vote_knife_time" ),"check_vote")
new i
for (i=0;i<32;i++)
{
players[i] = 0
}
votes = 0
if (get_cvar_num("amx_vote_knife_hud") == 1)
{
set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 5.0, 0.1, 0.2, CHANNEL)
show_hudmessage(id, "Schreibe /knife um eine messer Runde zu Voten^nDu hast %i sekunden zum Voten", get_cvar_num("amx_vote_knife_time"))
}
if (show[1] == 0)
client_print(0,print_chat,"[Messer] Schreibe /knife um eine MesserRunde zu Starten Du hast %i sekunden zum Voten, get_cvar_num("amx_vote_knife_time"))
show[1] = 1
}
else if(vote == 2)
{
if (get_cvar_num("amx_vote_knife_hud") == 1)
{
set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 5.0, 0.1, 0.2, CHANNEL)
show_hudmessage(id, "Normales game für %i runden ^nDanach kannst du nochmal Voten!", (knife_cooldown+1))
}
if (show[2] == 0)
client_print(0,print_chat,"[messer] Normales Spiel für %i mehr Runden! Dann bist du berechtigt nochmals zu Voten", (knife_cooldown+1))
show[2] = 1
}
}
public knife_vote(id)
{
if (players[id] == 1 && vote == 1)
{
if (get_cvar_num("amx_vote_knife_hud") == 1)
{
set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 5.0, 0.1, 0.2, CHANNEL)
show_hudmessage(id, "Du kannst nicht mehr als 1 mal Voten)
}
client_print(id,print_chat,"Du kannst nicht mehr als 1 mal Voten!")
}
else if (players[id] == 0 && vote == 1)
{
if (get_cvar_num("amx_vote_knife_hud") == 1)
{
set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 5.0, 0.1, 0.2, CHANNEL)
show_hudmessage(id, "Du hast erfolgreich gevotet")
}
client_print(id,print_chat,"Du hast erfolgreich gevotet")
votes = votes+1
players[id] = 1
}
else
{
if (get_cvar_num("amx_vote_knife_hud") == 1)
{
set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 5.0, 0.1, 0.2, CHANNEL)
show_hudmessage(id, "You can't vote!")
}
client_print(id,print_chat,"Du kannst nicht voten!!")
}
}
public check_vote(id)
{
vote = 0
new i
new check = 0
for (i=0;i<32;i++)
{
if (is_user_connected(i))
check = check + 1
}
if (floatround(votes/get_cvar_float("amx_vote_knife_ratio"))>=chec k)
{
knife_rounds = get_cvar_num("amx_vote_knife_rounds")
knife_cooldown = get_cvar_num("amx_vote_knife_cooldown")
if (get_cvar_num("amx_vote_knife_hud") == 1)
{
set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 5.0, 0.1, 0.2, CHANNEL)
show_hudmessage(id, "Voting succeded!^nNext %i rounds will be knife only", get_cvar_num("amx_vote_knife_rounds"))
}
if (show[3] == 0)
client_print(0,print_chat,"[Messer] Die nächsten %i Runden sind Messer Runden", get_cvar_num("amx_vote_knife_rounds"))
show[3] = 1
}
else
{
if (get_cvar_num("amx_vote_knife_hud") == 1)
{
set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 6.0, 5.0, 0.1, 0.2, CHANNEL)
show_hudmessage(id, "Voting failed, to few votes.")
}
if (show[4] == 0)
client_print(0,print_chat,"[Messer]Es ist kein Vote gestartet.")
show[4] = 1
}
}
public cur_weapon(id)
{
if (knife_rounds > 0 && knife_rounds < get_cvar_num("amx_vote_knife_rounds"))
engclient_cmd(id,"weapon_knife")
}
public reset_show()
{
new i
for (i=0;i<6;i++)
{
show[i] = 0
}
}
|