include amxmodx include amxmisc include file define PLUGIN is_Ogurec d

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <amxmodx>
#include <amxmisc>
#include <file>
#define PLUGIN "is_Ogurec"
#define VERSION "1.0"
#define AUTHOR "kiriman"
#define charsof(%1) (sizeof(%1)-1)
new Array:names_ini
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public plugin_natives ( ){
register_native("is_Ogurec", "native_is_Ogurec", 0)
names_ini = ArrayCreate(256)
}
public native_is_Ogurec(caller_plugin_id, params) {
new name[32]
new file[100]
get_string(1, file, 100)
get_string (2, name, 32)
if(file_exists(file) == 1)
{
new iLineFile = 0
new iTxtLength = 0
new szDataOutput[128]
while((iLineFile = read_file(file, iLineFile, szDataOutput, 127, iTxtLength)) != 0)
{
if(equali(szDataOutput, ";", 1) || (strlen(szDataOutput) == 0) ) continue
ArrayPushString(names_ini, szDataOutput)
}
}
new size = ArraySize(names_ini)
if(size == 1) return 0
for(new i = 1; i < size; i++)
{
new player[32]
ArrayGetString(names_ini, i, player, charsof(player))
if(equal(player, name)) return 1
}
return 0
}