include amxmodx include amxmisc include kiriman include cellarray incl

 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
47
48
49
50
51
52
53
54
55
56
57
58
#include <amxmodx>
#include <amxmisc>
#include <kiriman>
#include <cellarray>
#include <file>
#include <cstrike>
#define PLUGIN "is_Ogurec"
#define VERSION "1.0"
#define AUTHOR "kiriman"
#define charsof(%1) (sizeof(%1)-1)
new Array:arrListMaps
new Array:arrCountVoteMap
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public plugin_natives ( ){
register_native("is_Ogurec", "native_is_Ogurec", 1)
}
public native_is_Ogurec(caller_plugin_id, params) {
new name_player[32]
new name_file[100]
get_string(1, name_file, 100)
get_string (2, name_player, 32)
arrListMaps = ArrayCreate(256)
arrCountVoteMap = ArrayCreate(1)
ArrayPushString(arrListMaps, "^0")
ArrayPushCell(arrCountVoteMap, 0)
if(file_exists(name_file) == 1)
{
new iLineFile = 0
new iTxtLength = 0
new szDataOutput[128]
while((iLineFile = read_file(name_file, iLineFile, szDataOutput, 127, iTxtLength)) != 0)
{
if(equali(szDataOutput, ";", 1) || (strlen(szDataOutput) == 0) ) continue
ArrayPushString(arrListMaps, szDataOutput)
ArrayPushCell(arrCountVoteMap, 0)
}
}
if(ArraySize(arrListMaps) == 1) return 0
// Проверка на совпадение
for(new i = 1; i < ArraySize(arrListMaps); i++)
{
new szMap[128]
ArrayGetString(arrListMaps, i, szMap, charsof(szMap))
if(equal(szMap, name_player)) return 1
}
return 0
}