Fix some syntax errors in include files.
This commit is contained in:
parent
22df518ab5
commit
c37174cb97
@ -95,7 +95,19 @@ enum PluginStatus
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin information properties.
|
* Plugin information properties. Plugins can declare a global variable with
|
||||||
|
* their info. Example,
|
||||||
|
*
|
||||||
|
* public Plugin:myinfo = {
|
||||||
|
* name = "Admin Help",
|
||||||
|
* author = "AlliedModders LLC",
|
||||||
|
* description = "Display command information",
|
||||||
|
* version = "1.0",
|
||||||
|
* url = "http://www.sourcemod.net/"
|
||||||
|
* };
|
||||||
|
*
|
||||||
|
* SourceMod will display this information when a user inspects plugins in the
|
||||||
|
* console.
|
||||||
*/
|
*/
|
||||||
enum PluginInfo
|
enum PluginInfo
|
||||||
{
|
{
|
||||||
|
@ -682,15 +682,12 @@ native GetEntPropArraySize(entity, PropType:type, const String:prop[]);
|
|||||||
* @param array Array to read into.
|
* @param array Array to read into.
|
||||||
* @param arraySize Number of values to read.
|
* @param arraySize Number of values to read.
|
||||||
* @param dataSize Size of each value in bytes (1, 2, or 4).
|
* @param dataSize Size of each value in bytes (1, 2, or 4).
|
||||||
* @noreturn
|
|
||||||
* @error Invalid entity or offset out of reasonable bounds.
|
* @error Invalid entity or offset out of reasonable bounds.
|
||||||
*/
|
*/
|
||||||
stock GetEntDataArray(entity, offset, array[], arraySize, dataSize=4)
|
stock void GetEntDataArray(int entity, int offset, int[] array, int arraySize, int dataSize=4)
|
||||||
{
|
{
|
||||||
for (new i=0; i<arraySize; i++)
|
for (int i=0; i<arraySize; i++)
|
||||||
{
|
array[i] = GetEntData(entity, offset + i*dataSize, dataSize);
|
||||||
array[i] = GetEntData(entity, offset + i*dataSize, dataSize)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,59 +97,45 @@ stock Handle:FindPluginByFile(const String:filename[])
|
|||||||
* @deprecated Use FindTarget() or ProcessTargetString().
|
* @deprecated Use FindTarget() or ProcessTargetString().
|
||||||
*/
|
*/
|
||||||
#pragma deprecated Use FindTarget() or ProcessTargetString()
|
#pragma deprecated Use FindTarget() or ProcessTargetString()
|
||||||
stock SearchForClients(const String:pattern[], clients[], maxClients)
|
stock int SearchForClients(const char[] pattern, int[] clients, int maxClients)
|
||||||
{
|
{
|
||||||
new total = 0;
|
int total = 0;
|
||||||
|
|
||||||
if (maxClients == 0)
|
if (maxClients == 0)
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
if (pattern[0] == '#')
|
if (pattern[0] == '#') {
|
||||||
{
|
int input = StringToInt(pattern[1]);
|
||||||
new input = StringToInt(pattern[1]);
|
if (!input) {
|
||||||
if (!input)
|
char name[65];
|
||||||
{
|
for (int i=1; i<=MaxClients; i++) {
|
||||||
decl String:name[65]
|
|
||||||
for (new i=1; i<=MaxClients; i++)
|
|
||||||
{
|
|
||||||
if (!IsClientInGame(i))
|
if (!IsClientInGame(i))
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
GetClientName(i, name, sizeof(name));
|
GetClientName(i, name, sizeof(name));
|
||||||
if (strcmp(name, pattern, false) == 0)
|
if (strcmp(name, pattern, false) == 0) {
|
||||||
{
|
|
||||||
clients[0] = i;
|
clients[0] = i;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
new client = GetClientOfUserId(input);
|
int client = GetClientOfUserId(input);
|
||||||
if (client)
|
if (client) {
|
||||||
{
|
|
||||||
clients[0] = client;
|
clients[0] = client;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
decl String:name[65]
|
char name[65];
|
||||||
for (new i=1; i<=MaxClients; i++)
|
for (int i=1; i<=MaxClients; i++)
|
||||||
{
|
{
|
||||||
if (!IsClientInGame(i))
|
if (!IsClientInGame(i))
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
GetClientName(i, name, sizeof(name));
|
GetClientName(i, name, sizeof(name));
|
||||||
if (StrContains(name, pattern, false) != -1)
|
if (StrContains(name, pattern, false) != -1) {
|
||||||
{
|
|
||||||
clients[total++] = i;
|
clients[total++] = i;
|
||||||
if (total >= maxClients)
|
if (total >= maxClients)
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,18 +83,6 @@ enum APLRes
|
|||||||
APLRes_SilentFailure /**< Plugin shouldn't load but do so silently */
|
APLRes_SilentFailure /**< Plugin shouldn't load but do so silently */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Declare this as a struct in your plugin to expose its information.
|
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* public Plugin:myinfo =
|
|
||||||
* {
|
|
||||||
* name = "My Plugin",
|
|
||||||
* //etc
|
|
||||||
* };
|
|
||||||
*/
|
|
||||||
public Plugin:myinfo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the plugin is fully initialized and all known external references
|
* Called when the plugin is fully initialized and all known external references
|
||||||
* are resolved. This is only called once in the lifetime of the plugin, and is
|
* are resolved. This is only called once in the lifetime of the plugin, and is
|
||||||
|
@ -433,30 +433,19 @@ stock CharToLower(chr)
|
|||||||
* @return The index of the first occurrence of the character
|
* @return The index of the first occurrence of the character
|
||||||
* in the string, or -1 if the character was not found.
|
* in the string, or -1 if the character was not found.
|
||||||
*/
|
*/
|
||||||
stock FindCharInString(const String:str[], c, bool:reverse = false)
|
stock int FindCharInString(const char[] str, char c, bool reverse = false)
|
||||||
{
|
{
|
||||||
new i, len
|
int len = strlen(str);
|
||||||
|
|
||||||
len = strlen(str);
|
|
||||||
|
|
||||||
if (!reverse)
|
if (!reverse) {
|
||||||
{
|
for (int i = 0; i < len; i++) {
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
{
|
|
||||||
if (str[i] == c)
|
if (str[i] == c)
|
||||||
{
|
|
||||||
return i;
|
return i;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
for (int i = len - 1; i >= 0; i--) {
|
||||||
{
|
|
||||||
for (i = len - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
if (str[i] == c)
|
if (str[i] == c)
|
||||||
{
|
|
||||||
return i;
|
return i;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user