BANNED
|
09-26-2020
, 07:38
What is the reason why this plugin causes the server to crash continuously? can Autho
|
#1
|
If I do not install SteamWorks, it gives this error, and when I install it, the server constantly crashes.
player_connect_announce.smx (Player Connect Announce): Required extension "SteamWorks" file("SteamWorks.ext") not running
By the way, the plugin is a special plugin, do not use it without permission.
PHP Code:
public PlVers:__version =
{
version = 5,
filevers = "1.10.0.6488",
date = "09/11/2020",
time = "19:29:17"
};
new Float:NULL_VECTOR[3];
new String:NULL_STRING[16];
public Extension:__ext_core =
{
name = "Core",
file = "core",
autoload = 0,
required = 0,
};
new MaxClients;
public Extension:__ext_sdktools =
{
name = "SDKTools",
file = "sdktools.ext",
autoload = 1,
required = 1,
};
public Extension:__ext_geoip =
{
name = "GeoIP",
file = "geoip.ext",
autoload = 1,
required = 1,
};
public Extension:__ext_geoipcity =
{
name = "GeoIPCity",
file = "geoipcity.ext",
autoload = 1,
required = 1,
};
new String:CTag[][28];
new String:CTagCode[16][28] =
{
"\x01",
"\x04",
"\x03",
"\x03",
"\x03",
"\x05",
"\x03",
"",
"\x03",
"",
"",
"",
"",
"",
"",
""
};
new bool:CTagReqSayText2[7] =
{
0, 0, 1, 1, 1, 0, 1
};
new bool:CEventIsHooked;
new bool:CSkipList[66];
new bool:CProfile_Colors[7] =
{
1, 1, 0, 0, 0, 0, 0
};
new CProfile_TeamIndex[7] =
{
-1, ...
};
new bool:CProfile_SayText2;
public Extension:__ext_SteamWorks =
{
name = "SteamWorks",
file = "SteamWorks.ext",
autoload = 1,
required = 1,
};
new bool:g_UseGeoIPCity;
new bool:bClientSteam[66];
new bool:bConnectFail[66];
new String:sSteamID[20][264];
new ConVar:announce_join_message_timer;
new Handle:Join_Timer[66];
public Plugin:myinfo =
{
name = "Player Connect Announce",
description = "Player Connect Announce",
author = "SupermenCJ",
version = "1.0",
url = "http://zambiland.ru"
};
void:Get_SteamWorks(client)
{
new String:sURL[288];
FormatEx(sURL, 70, "https://steamcommunity.com/profiles/%s?xml=1", sSteamID[client]);
new Handle:hRequest = SteamWorks_CreateHTTPRequest(1, sURL);
SteamWorks_SetHTTPCallbacks(hRequest, 41, -1, -1, 0);
SteamWorks_SetHTTPRequestContextValue(hRequest, client, 0);
SteamWorks_SendHTTPRequest(hRequest);
return 0;
}
bool:IsLanIP(String:src[64])
{
new String:ip4[4][16];
new ipnum;
if (ExplodeString(src[0], ".", ip4, 4, 4, false) == 4)
{
ipnum = StringToInt(ip4[2], 10) + StringToInt(ip4[1], 10) * 256 + StringToInt(ip4[0][ip4], 10) * 65536;
new var1;
if ((ipnum >= 655360 && ipnum < 720895) || (ipnum >= 11276288 && ipnum < 11280383) || (ipnum >= 12625920 && ipnum < 12626175))
{
return 1;
}
}
return 0;
}
bool:StrEqual(String:str1[], String:str2[], bool:caseSensitive)
{
return strcmp(str1[0], str2[0], caseSensitive) == 0;
}
ExplodeString(String:text[], String:split[], String:buffers[][], maxStrings, maxStringLength, bool:copyRemainder)
{
new reloc_idx;
new idx;
new total;
new var1;
if (maxStrings < 1 || split[0])
{
return 0;
}
while ((idx = SplitString(reloc_idx + text[0], split[0], buffers[0][total], maxStringLength)) != -1)
{
reloc_idx = idx + reloc_idx;
total++;
if (maxStrings == total)
{
if (copyRemainder)
{
strcopy(buffers[0][total + -1], maxStringLength, reloc_idx - idx + text[0]);
}
return total;
}
}
total++;
strcopy(buffers[0][total], maxStringLength, reloc_idx + text[0]);
return total;
}
Handle:StartMessageOne(String:msgname[], client, flags)
{
new players[1];
players[0] = client;
return StartMessage(msgname[0], players, 1, flags);
}
void:EmitSoundToAll(String:sample[], entity, channel, level, flags, Float:volume, pitch, speakerentity, Float:origin[3], Float:dir[3], bool:updatePos, Float:soundtime)
{
new clients[MaxClients];
new total;
new i = 1;
while (i <= MaxClients)
{
if (IsClientInGame(i))
{
total++;
clients[0][total] = i;
}
i++;
}
if (total)
{
EmitSound(clients[0], total, sample[0], entity, channel, level, flags, volume, pitch, speakerentity, origin[0], dir[0], updatePos, soundtime);
}
return 0;
}
void:CPrintToChat(client, String:szMessage[], any:_arg2)
{
new var1;
if (client <= 0 || client > MaxClients)
{
ThrowError("Invalid client index %d", client);
}
if (!(IsClientInGame(client)))
{
ThrowError("Client %d is not in game", client);
}
new String:szBuffer[1008];
new String:szCMessage[1008];
SetGlobalTransTarget(client);
Format(szBuffer, 250, "\x01%s", szMessage[0]);
VFormat(szCMessage, 250, szBuffer, 3);
new index = CFormat(szCMessage, 250, -1);
if (index == -1)
{
PrintToChat(client, szCMessage);
}
else
{
CSayText2(client, index, szCMessage);
}
return 0;
}
void:CPrintToChatAll(String:szMessage[], any:_arg1)
{
new String:szBuffer[1008];
new i = 1;
while (i <= MaxClients)
{
new var1;
if (IsClientInGame(i) && IsFakeClient(i) && CSkipList[i])
{
SetGlobalTransTarget(i);
VFormat(szBuffer, 250, szMessage[0], 2);
CPrintToChat(i, szBuffer);
}
CSkipList[i] = 0;
i++;
}
return 0;
}
CFormat(String:szMessage[], maxlength, author)
{
if (!CEventIsHooked)
{
CSetupProfile();
HookEvent("server_spawn", 29, 2);
CEventIsHooked = true;
}
new iRandomPlayer = -1;
if (author != -1)
{
if (CProfile_SayText2)
{
ReplaceString(szMessage[0], maxlength, "{teamcolor}", "\x03", true);
iRandomPlayer = author;
}
else
{
ReplaceString(szMessage[0], maxlength, "{teamcolor}", CTagCode[1], true);
}
}
else
{
ReplaceString(szMessage[0], maxlength, "{teamcolor}", "", true);
}
new i;
while (i < 7)
{
if (!(StrContains(szMessage[0], CTag[i], true) == -1))
{
if (CProfile_Colors[i])
{
if (CTagReqSayText2[i])
{
if (CProfile_SayText2)
{
if (iRandomPlayer == -1)
{
iRandomPlayer = CFindRandomPlayerByTeam(CProfile_TeamIndex[i]);
if (iRandomPlayer == -2)
{
ReplaceString(szMessage[0], maxlength, CTag[i], CTagCode[1], true);
}
else
{
ReplaceString(szMessage[0], maxlength, CTag[i], CTagCode[i], true);
}
}
ThrowError("Using two team colors in one message is not allowed");
}
ReplaceString(szMessage[0], maxlength, CTag[i], CTagCode[1], true);
}
ReplaceString(szMessage[0], maxlength, CTag[i], CTagCode[i], true);
}
else
{
ReplaceString(szMessage[0], maxlength, CTag[i], CTagCode[1], true);
}
}
i++;
}
return iRandomPlayer;
}
CFindRandomPlayerByTeam(color_team)
{
if (color_team)
{
new i = 1;
while (i <= MaxClients)
{
new var1;
if (IsClientInGame(i) && color_team == GetClientTeam(i))
{
return i;
}
i++;
}
return -2;
}
return 0;
}
void:CSayText2(client, author, String:szMessage[])
{
new Handle:hBuffer = StartMessageOne("SayText2", client, 0);
BfWriteByte(hBuffer, author);
BfWriteByte(hBuffer, 1);
BfWriteString(hBuffer, szMessage[0]);
EndMessage();
return 0;
}
void:CSetupProfile()
{
new String:szGameName[128];
GetGameFolderName(szGameName, 30);
if (StrEqual(szGameName, "cstrike", false))
{
CProfile_Colors[2] = 1;
CProfile_Colors[3] = 1;
CProfile_Colors[4] = 1;
CProfile_Colors[5] = 1;
CProfile_TeamIndex[2] = 0;
CProfile_TeamIndex[3] = 2;
CProfile_TeamIndex[4] = 3;
CProfile_SayText2 = true;
}
else
{
if (StrEqual(szGameName, "tf", false))
{
CProfile_Colors[2] = 1;
CProfile_Colors[3] = 1;
CProfile_Colors[4] = 1;
CProfile_Colors[5] = 1;
CProfile_TeamIndex[2] = 0;
CProfile_TeamIndex[3] = 2;
CProfile_TeamIndex[4] = 3;
CProfile_SayText2 = true;
}
new var1;
if (StrEqual(szGameName, "left4dead", false) || StrEqual(szGameName, "left4dead2", false))
{
CProfile_Colors[2] = 1;
CProfile_Colors[3] = 1;
Last edited by Darkwob; 09-26-2020 at 07:44.
|
|