erot
Участник
- Сообщения
- 43
- Реакции
- 2
Извините конечно, что задаю много вопросов по поводу программирования, но я не могу понять как исправить....чтоб ошибки не было в логах
Вот то, что я написал,
Зомби когда убивают не партует к матке вот что пишет в логах ошибка
Подскажите как мне исправить эту проблему разбирающиеся люди имеющие опыт в программировании для игры CS Source!
Вот то, что я написал,
C-подобный:
new PlVers:__version = 5;
new Float:NULL_VECTOR[3];
new String:NULL_STRING[1];
new Extension:__ext_core = 64;
new MaxClients;
new Extension:__ext_cstrike = 180;
new Extension:__ext_sdktools = 228;
new Extension:__ext_sdkhooks = 272;
public Plugin:myinfo =
{
name = "Respawn zombie",
description = "Zombie Respawn Mod",
author = "erot",
version = "1.0",
url = "http://hlmod.ru/"
};
new QueuePointer;
new Queue[65];
new bool:IsRespawnEnabled;
new RoundCounter;
new bool:IsMapConfigLoaded;
new bool:IsFinalEntityHooked;
new String:FinalEntityName[8];
new String:FinalEntityOutput[8];
new Handle:TimerDisableRespawn;
new Handle:CvarZERespawnOFFtime;
new Handle:CvarZERespawnInterval;
new Handle:CvarZombiePercentage;
new Handle:CvarFreezeTime;
new Handle:CvarRoundTime;
new Handle:CvarZRRespawn;
public __ext_core_SetNTVOptional()
{
MarkNativeAsOptional("GetFeatureStatus");
MarkNativeAsOptional("RequireFeature");
MarkNativeAsOptional("AddCommandListener");
MarkNativeAsOptional("RemoveCommandListener");
VerifyCoreVersion();
return 0;
}
bool:operator<(Float:,Float:)(Float:oper1, Float:oper2)
{
return FloatCompare(oper1, oper2) < 0;
}
bool:StrEqual(String:str1[], String:str2[], bool:caseSensitive)
{
return strcmp(str1, str2, caseSensitive) == 0;
}
public OnMapStart()
{
RoundCounter = 0;
IsMapConfigLoaded = 0;
AutoExecConfig(true, "ze_respawn", "sourcemod");
LoadMapConfig();
ClearQueue();
return 0;
}
public OnPluginStart()
{
HookEvent("round_start", EventHook:17, EventHookMode:1);
HookEvent("round_end", EventHook:15, EventHookMode:1);
HookEvent("player_death", EventHook:11, EventHookMode:1);
CvarFreezeTime = FindConVar("mp_freezetime");
CvarRoundTime = FindConVar("mp_roundtime");
CvarZRRespawn = FindConVar("zr_respawn");
CvarZERespawnOFFtime = CreateConVar("ze_respawn_offtime", "2.0", "Time before endround when ze_respawn turn off", 0, false, 0, false, 0);
CvarZERespawnInterval = CreateConVar("ze_respawn_interval", "2.0", "ZE-Respawn interval", 0, false, 0, false, 0);
CvarZombiePercentage = CreateConVar("ze_respawn_zombie_percentage", "50", "Percentage of Zombies", 0, false, 0, false, 0);
CreateDirectory("cfg/sourcemod/ze_respawn_map_configs", 511);
return 0;
}
public Action:OnRoundStart(Handle:event, String:name[], bool:dontBroadcast)
{
RoundCounter += 1;
ClearQueue();
new Float:respawnLifeTime = FloatMul(60, FloatSub(FloatAdd(GetConVarFloat(CvarRoundTime), GetConVarFloat(CvarFreezeTime)), GetConVarFloat(CvarZERespawnOFFtime)));
TimerDisableRespawn = CreateTimer(respawnLifeTime, DisableRespawn, any:0, 2);
return Action:0;
}
public OnEntityCreated(entity, String:classname[])
{
if (entity > 65) {
if (IsValidEntity(entity)) {
SDKHook(entity, SDKHookType:7, SDKHookCB:5);
}
}
return 0;
}
public OnEntitySpawned(entity)
{
if (IsMapConfigLoaded) {
if (!IsValidEdict(entity)) {
return 0;
}
decl String:name[32];
GetEntPropString(entity, PropType:1, "m_iName", name, 32);
if (StrEqual(name, FinalEntityName, false)) {
HookSingleEntityOutput(entity, FinalEntityOutput, EntityOutput:7, true);
IsFinalEntityHooked = 1;
}
}
return 0;
}
public Action:OnRoundEnd(Handle:event, String:name[], bool:dontBroadcast)
{
ClearQueue();
IsRespawnEnabled = 0;
if (TimerDisableRespawn) {
KillTimer(TimerDisableRespawn, false);
TimerDisableRespawn = 0;
}
return Action:0;
}
public Action:OnPlayerDeath(Handle:event, String:name[], bool:dontBroadcast)
{
new var1;
if (IsRespawnEnabled) {
new userID = GetEventInt(event, "userid");
new client = GetClientOfUserId(userID);
if (IsClientObserver(client)) {
AddPlayerToQueue(userID);
CreateTimer(GetConVarFloat(CvarZERespawnInterval), RespawnPlayer, RoundCounter, 2);
}
}
return Action:0;
}
public ZR_OnClientInfected(client, attacker, bool:motherInfect, bool:respawnOverride, bool:respawn)
{
new var1;
if (motherInfect) {
IsRespawnEnabled = 1;
}
return 0;
}
LoadMapConfig()
{
decl String:mapName[32];
GetCurrentMap(mapName, 32);
decl String:filePath[256];
if (FileExists(filePath, false)) {
new Handle:kv = CreateKeyValues("ze_respawn", "", "");
FileToKeyValues(kv, filePath);
if (!KvJumpToKey(kv, "entity", false)) {
LogError("unable to load ze_respawn entity config in %s", filePath);
} else {
KvGetString(kv, "name", FinalEntityName, 32, "");
KvGetString(kv, "output", FinalEntityOutput, 32, "");
}
new var1;
if (!StrEqual(FinalEntityName, "", true)) {
IsMapConfigLoaded = 1;
}
CloseHandle(kv);
}
return 0;
}
public OnFinalEntityOutput(String:output[], caller, activator, Float:delay)
{
IsRespawnEnabled = 0;
return 0;
}
public Action:DisableRespawn(Handle:timer)
{
if (!IsFinalEntityHooked) {
IsRespawnEnabled = 0;
}
TimerDisableRespawn = 0;
return Action:4;
}
public Action:RespawnPlayer(Handle:timer, round)
{
if (RoundCounter == round) {
RespawnPlayerIfNeeded();
}
return Action:4;
}
/* ERROR! Unrecognized opcode: genarray_z */
function "RespawnPlayerIfNeeded" (number 15)
/* ERROR! Unrecognized opcode: dec */
function "GetNextClientFromQueue" (number 16)
AddPlayerToQueue(userid)
{
if (QueuePointer < 65) {
QueuePointer += 1;
Queue[QueuePointer] = userid;
}
return 0;
}
ClearQueue()
{
new i = 0;
while (i <= QueuePointer) {
Queue[i] = 0;
i++;
}
QueuePointer = 0;
return 0;
}
GetQueueSize()
{
return QueuePointer;
}
Зомби когда убивают не партует к матке вот что пишет в логах ошибка
C-подобный:
L 11/22/2011 - 21:08:53: [SM] Native "GetConVarInt" reported: Invalid convar handle 0 (error 4)
L 11/22/2011 - 21:08:53: [SM] Displaying call stack trace for plugin "ze_respawn.smx":
L 11/22/2011 - 21:08:53: [SM] [0] Line 115, ze_respawn.sp::OnPlayerDeath()
Подскажите как мне исправить эту проблему разбирающиеся люди имеющие опыт в программировании для игры CS Source!
Последнее редактирование модератором: