Sziasztok!
Az egyik pluginomra ezt írja a szeró! L 07/30/2010 - 14:19:20: [AMXX] Run time error 10 (plugin "ujraelesztes.amxx") (native "cs_get_user_team") - debug not enabled! Ha jól tudom ez hibát jelent és emiatt fagyhat ki a szeró. Valaki átudná nézni aki ért is valamennyit hozzá?
Kód: /* Random Respawn Chance * by Bo0m! * www.Chaos-Realms.com * Created 5-08-2006 * Last update: 8-09-2006 * * With this plugin you have a random chance to respawn by saying: * respawn me * respawnme * revive me * reviveme * /revive * /reviveme * * The chance for you to respawn is set by spawnchance_odds * Example: If you want a 1 in 50 chance to respawn, set spawnchance_odds to 50 * The default is a 1 in 10 chance you will respawn. * * By default there is a 150 second (2.5 minute) wait between times you can try to respawn * This can be changed by spawnchance_wait * * A feature has been added that can give admins a bit of a bonus (if they have immunity) * Admins can either have no wait time, or always win a respawn regardless of the odds * spawnchance_adminbonus 1 gives admins no waiting to try and respawn * spawnchance_adminbonus 2 makes admins win a respawn every time * By default this feature if off * * A message is displayed to notify players that they have a chance to respawn * It is displayed every 75 seconds by default * This can be changed with spawnchance_msgtime * Messages can be enabled/disabled with spawnchance_msg * * To enable/disable this plugin use the cvar spawnchance_on * * Notes: * This is my first attempt at a plugin :) * Some parts of this plugin are based on Striker's Advanced Roll The Dice * * * ************************************************************************************** * Changelog * * v0.9 - Knocked off the 'amx_' prefix on cvars (They're long enough already) * - Changed amx_spawnchance cvar to spawnchance_on * - Fixed problem where you'd lose your chance if respawned when the round's over * * v0.8 - Added special feature for admins by request * - Fixed bug with wait cvar * * v0.7 - Fixed bug with message cvar * - Changed default message time cvar * - Removed /respawnme * * v0.6 - Added a cvar to choose time between respawn message * * v0.5 - Added a message to notify players about the respawn chance * - Added cvar spawnchance_msg to enable/disable message * - Added reviveme and revive me * * v0.4 - Minor bug fix * - Changed how the odds reset if less than 2 or greater than 1000 * - Changed defaulting if too low/high to changing to least/most * * v0.3 - Made it to reset odds to default if less than 2 or greater than 1000 * * v0.2 - Fixed bug where spectators could respawn * - Decreased default wait time and increased default winning odds * - Added /revive and /reviveme * - Gave player a knife on respawn due to certain map issues * * v0.1 - Initial Release * * ************************************************************************************** * And let's not forget: * * Random Respawn Chance (respawnchance.sma) * Copyright (C) 2006 Bo0m! * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * In addition, as a special exception, the author gives permission to * link the code of this program with the Half-Life Game Engine ("HL * Engine") and Modified Game Libraries ("MODs") developed by Valve, * L.L.C ("Valve"). You must obey the GNU General Public License in all * respects for all of the code used other than the HL Engine and MODs * from Valve. If you modify this file, you may extend this exception * to your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from your * version. */
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike>
new Float:LastSpawnAttempt[33] new bool:RoundEnded = false
public plugin_init() { register_plugin("Random Respawn Chance", "0.9", "Bo0m!") register_clcmd("say", "spawnchance") register_cvar("spawnchance_on","1") register_cvar("spawnchance_msg","1") register_cvar("spawnchance_msgtime","75") register_cvar("spawnchance_odds","10") register_cvar("spawnchance_wait","150") register_cvar("spawnchance_adminbonus","0") register_logevent("event_RoundStarted", 2, "1=Round_Start") register_logevent("event_RoundEnded", 2, "1=Round_End") }
public plugin_precache() { precache_sound("debris/beamstart9.wav") }
public client_putinserver(id) { if(is_user_bot(id)) return PLUGIN_HANDLED
set_task(20.0, "spawnmessage", id) LastSpawnAttempt[id] = -5000.0 return PLUGIN_CONTINUE }
public client_disconnect(id) { if(is_user_bot(id)) return PLUGIN_HANDLED
LastSpawnAttempt[id] = -5000.0 return PLUGIN_CONTINUE }
public event_RoundStarted() { RoundEnded = false }
public event_RoundEnded() { RoundEnded = true }
public spawnagain(id) { spawn(id) give_item(id,"weapon_knife") return PLUGIN_CONTINUE }
public spawnmessage(id) { if (!get_cvar_num("spawnchance_on") || !get_cvar_num("spawnchance_msg")) return PLUGIN_HANDLED
if(get_cvar_num("spawnchance_msgtime") < 10) { server_cmd ("spawnchance_msgtime 10") return PLUGIN_CONTINUE }
if(is_user_connected(id)) client_print(id, print_chat, "[Ujraeledes] 1 a %d az eselyed hogy ujraeledj miutan meghaltal! Ird ujraeleszt az ujraeleszteshez!",get_cvar_num("spawnchance_odds")) set_task(get_cvar_float("spawnchance_msgtime"), "spawnmessage", id) return PLUGIN_HANDLED }
public spawnchance(id) { new Speech[192] read_args(Speech,192) remove_quotes(Speech)
if(get_cvar_num("spawnchance_odds") < 2) { server_cmd ("spawnchance_odds 2") return PLUGIN_CONTINUE } if(get_cvar_num("spawnchance_odds") > 1000) { server_cmd ("spawnchance_odds 1000") return PLUGIN_CONTINUE } if(get_cvar_num("spawnchance_wait") < 0) { server_cmd ("spawnchance_wait 0") return PLUGIN_CONTINUE } if(get_cvar_num("spawnchance_wait") > 5000) { server_cmd ("spawnchance_wait 5000") return PLUGIN_CONTINUE }
if(spawnchance2(id,Speech)) return PLUGIN_HANDLED return PLUGIN_CONTINUE }
public spawnchance2(id,Speech[]) { if (get_cvar_num("spawnchance_adminbonus") == 1 && (get_user_flags(id) & ADMIN_IMMUNITY) ) { LastSpawnAttempt[id] = -5000.0 } if ( (equali(Speech, "respawnme")) || (equali(Speech, "ujraeleszt")) || (equali(Speech, "reviveme")) || (equali(Speech, "/revive")) || (equali(Speech, "/reviveme")) || (equali(Speech, "respawn me")) ) { if (get_cvar_num("spawnchance_on") == 0) { client_print(id, print_chat, "Ujraelesztes nincs engedelyezve.") return PLUGIN_HANDLED } if (cs_get_user_team(id) == CS_TEAM_SPECTATOR) { client_print(id, print_chat, "Specator nem eled ujra butus!.") return PLUGIN_HANDLED } if (RoundEnded == true) { client_print(id, print_chat, "A kor vegetert lejart az ujraeledes idelye!.") return PLUGIN_HANDLED } if (is_user_alive(id) == 1) { client_print(id,print_chat, "Csak akkor eledsz ujra miutan meghaltal!") return PLUGIN_HANDLED } else if (get_gametime() < LastSpawnAttempt[id] + get_cvar_float("spawnchance_wait")) { client_print(id,print_chat, "Sajnos nem tudsz ujraeledni most! Probald %d masodperc mulva.",floatround(LastSpawnAttempt[id] + get_cvar_num("spawnchance_wait") - get_gametime() + 1)) return PLUGIN_HANDLED }
new ChanceAmount = random(get_cvar_num("spawnchance_odds")) new User[32] get_user_name(id,User,32) if (get_cvar_num("spawnchance_adminbonus") == 2 && (get_user_flags(id) & ADMIN_IMMUNITY) ) { client_cmd(id,"spk debris/beamstart9") client_print(id,print_chat, "Keszulj az ujraeleszteshez!") spawn(id) set_task(0.5,"spawnagain",id) set_hudmessage(200,0,0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1) show_hudmessage(0,"%s ujralett elesztve!",User) } else { if (1 == ChanceAmount) { client_cmd(id,"spk debris/beamstart9") client_print(id,print_chat, "Keszulj az ujraeleszteshez!") spawn(id) set_task(0.5,"spawnagain",id) set_hudmessage(200,0,0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1) show_hudmessage(0,"%s ujralett elesztve!",User) } else if (ChanceAmount > 1) { client_print(id,print_chat, "Sajnos nem tudsz feltamadni!") }
LastSpawnAttempt[id] = get_gametime() return PLUGIN_CONTINUE } return PLUGIN_CONTINUE } return PLUGIN_CONTINUE }
|