please someone could correct me errors plugin and that sends the following errors:
/groups/sourcemod/upload_tmp/textjhTYvj.sp(43) : error 023: array assignment must be simple assignment
/groups/sourcemod/upload_tmp/textjhTYvj.sp(64) : error 017: undefined symbol "RecentMap"
/groups/sourcemod/upload_tmp/textjhTYvj.sp(66) : error 047: array sizes do not match, or destination array is too small
/groups/sourcemod/upload_tmp/textjhTYvj.sp(61) : warning 203: symbol is never used: "stay"
explanation of plugin: the plugin is a votemap that starts when the server recibel the "votemap_iniciar" command when the voting starts receiving lasts 10 seconds after the voting ends and sm_nextmap "mapwinner" sets the command
and when changing map and it restarts the vote, played the last two maps played do not appear on the voting.
Please fix errors..
This is the code:
PHP Code:
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo =
{
name = "D",
author = "D",
description = "D",
version = "1.0",
url = "D"
};
public OnPluginStart()
{
RegAdminCmd("votemap_iniciar", Command_vote, ADMFLAG_SLAY);
}
public Handle_VoteMenu(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_End)
{
CloseHandle(menu);
}
else if (action == MenuAction_VoteEnd)
{
if (param1 == 0)
{
new String:map[64];
GetMenuItem(menu, param1, map, sizeof(map));
ServerCommand("sm_nextmap %s", map);
}
}
}
public Action:Command_vote(client, args)
{
if (IsVoteInProgress())
{
return;
}
new String:maps[5][25];
maps = VoteMaps();
new Handle:menu = CreateMenu(Handle_VoteMenu);
SetMenuTitle(menu, "Votemap");
for(new i=0; i < 5; i++)
{
AddMenuItem(menu, maps[i], maps[i])
}
SetMenuExitButton(menu, false);
VoteMenuToAll(menu, 20);
}
String:VoteMaps()
{
decl String:path[PLATFORM_MAX_PATH], String:line[128];
BuildPath(Path_SM, path, PLATFORM_MAX_PATH, "maplist.txt");
new Handle:fileHandle=OpenFile(path, "r");
new String:maps[5][25];
new i=0;
new bool:stay;
ReadFileLine(fileHandle, line, sizeof(line))
while(!IsEndOfFile(fileHandle) && !RecentMap(line))
{
maps[i] = line;
ReadFileLine(fileHandle, line, sizeof(line))
i++;
}
CloseHandle(fileHandle);
return maps;
}
thx..