03.04.2016, 13:23
Код:
C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(52) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(94) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(102) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(107) : warning 202: number of arguments does not match definition C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(119) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(127) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(132) : warning 202: number of arguments does not match definition C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(138) : warning 209: function "OnDialogResponse" should return a value C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(139) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(141) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(143) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(146) : error 021: symbol already defined: "SendClientMessage" C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(149) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(151) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(153) : error 021: symbol already defined: "string" C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(159) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(162) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(164) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(166) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(168) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(172) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(174) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(176) : error 021: symbol already defined: "string" C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(182) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(185) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(187) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(189) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(191) : error 021: symbol already defined: "string" C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(197) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(199) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(201) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(203) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(205) : error 010: invalid function or declaration C:\Users\Kevin Burke\Desktop\#Burke\filterscripts\K-RCON.pwn(207) : error 021: symbol already defined: "string"
Код:
/* Thanks to SA:MP Team for SA:MP
Thanks to Zeex for ZCMD
Thanks to Kevin Burke/KevinExec for K-RCON*/
//------------------------------------------------------------------------------------------------------------//
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define DIALOG_KRCON 1
#define DIALOG_KHOSTNAME 2
#define DIALOG_KMAPNAME 3
#define DIALOG_KURL 4
#define DIALOG_KPASSWORD 5
#define DIALOG_KUNLOCK 6
#define DIALOG_RCON 7
new
khostname[128],
kmapname[128],
kurl[128],
rcon[128],
bool:server_passworded;
public OnFilterScriptInit()
{
SendRconCommand("hostname Kevin's Server");
SendRconCommand("language Any");
SendRconCommand("mapname K-MAP");
SetGameModeText("K-SERVER");
print("\n--------------------------------");
print(" K-RCON loaded.");
print(" By Kevin Burke/KevinExec");
print("---------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
print("\n-------------------------------");
print(" K-RCON unloaded.");
print(" By Kevin Burke/KevinExec");
print("--------------------------------\n");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
new string[128];
if(listitem == 0)
{
format(string, sizeof(string), "Hostname: %s\n\nEnter the new hostname you wish to have.", khostname);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Hostname", string, "Proceed", "Close");
return 1;
}
if(listitem == 1)
{
format(string, sizeof(string), "Mapname: %s\n\nEnter the new mapname you wish to have. ", kmapname);
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Mapname", string, "Proceed", "Close");
return 1;
}
if(listitem == 2)
{
format(string, sizeof(string), "Current URL: %s\n\nEnter the new URL below.", kurl);
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "URL", string, "Proceed", "Close");
return 1;
}
if(listitem == 3)
{
switch(server_passworded)
{
case false: ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Lock Server", "The server isn't locked at the moment.\n\nIf you want to lock it, please enter a password below.", "Proceed", "Close");
case true: ShowPlayerDialog(playerid, 6, DIALOG_STYLE_MSGBOX, "Unlock Server", "The server is locked at the moment..\n\nIf you want to unlock it, please press >Proceed<.", "Proceed", "Close");
}
return 1;
}
if(listitem == 4)
{
format(string, sizeof(string), "RCON Password: %s\n\nIf you wish to change it, please enter the new RCON password below.", rcon);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "RCON", string, "Proceed", "Close");
return 1;
}
}
}
if(dialogid == 2)
{
if(response)
{
if(!inputtext[0])
{
new string[128];
SendClientMessage(playerid, 0xFF0000FF, "[ERROR] You haven't typed anything.");
format(string, sizeof(string), "Hostname: %s\n\nIf you wish to change the hostname, enter the new hostname below.", khostname);
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "New Hostname", string, "Proceed", "Close");
return 1;
}
else
{
new string[128];
format(string, sizeof(string), "hostname %s", inputtext);
SendRconCommand(string);
format(khostname, sizeof(khostname), inputtext);
format(string, sizeof(string), "SERVER: %s has changed the hostname to %s", GetName(playerid), inputtext);
SendClientMessageToAll(0xFF0000FF, string, 1);
return 1;
}
}
else ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}K-RCON by {33CCFF}Kevin Burke/KevinExec", "Change Hostname\nChange Mapname\nChange URL\nLock/Unlock Server\nRCON Password", "Select", "Close");
}
if(dialogid == 3)
{
if(response)
{
if(!inputtext[0])
{
new string[128];
SendClientMessage(playerid, 0xFF0000FF, "[ERROR] You haven't typed anything.");
format(string, sizeof(string), "Mapname: %s\n\nIf you wish the change the mapname, enter the new mapname below.", kmapname);
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Change Mapname", string, "Proceed", "Close");
return 1;
}
else
{
new string[128];
format(string, sizeof(string), "mapname %s", inputtext);
SendRconCommand(string);
format(kmapname, sizeof(kmapname), inputtext);
format(string, sizeof(string), "SERVER: %s has changed the mapname to %s", GetName(playerid), inputtext);
SendClientMessageToAll(0xFF0000FF, string, 1);
return 1;
}
}
else ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}K-RCON by {33CCFF}Kevin Burke/KevinExec", "Change Hostname\nChange Mapname\nChange URL\nLock/Unlock Server\nRCON Password", "Select", "Close");
}
}
if(dialogid == 4)
{
if(response)
{
if(!inputtext[0])
{
new string[128];
SendClientMessage(playerid, 0xFF0000FF, "[ERROR] You haven't typed anything.");
format(string, sizeof(string), "Current URL: %s\n\nIf you wish to change the server URL, enter the new URL below.", kurl);
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Change URL", string, "Proceed", "Close");
return 1;
}
else
{
new string[128];
format(string, sizeof(string), "weburl %s", inputtext);
SendRconCommand(string);
format(kurl, sizeof(kurl), inputtext);
format(string, sizeof(string), "SERVER: %s has changed the Server URL to %s", GetName(playerid), inputtext);
SendClientMessageToAll(0xFF0000FF, string, 1);
return 1;
}
}
else ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}K-RCON by {33CCFF}Kevin Burke/KevinExec", "Change Hostname\nChange Mapname\nChange URL\nLock/Unlock Server\nRCON Password", "Select", "Close");
}
if(dialogid == 5)
{
if(response)
{
if(!inputtext[0])
{
SendClientMessage(playerid, 0xFF0000FF, "[ERROR] You haven't typed anything.");
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "", "The server is currently NOT locked.\n\nPlease enter a password below to lock the server.", "Lock", "Back");
return 1;
}
else
{
new string[128];
format(string, sizeof(string), "password %s", inputtext);
SendRconCommand(string);
server_passworded = true;
format(string, sizeof(string), "SERVER: %s has locked the server. (password = %s)", GetName(playerid), inputtext);
SendClientMessageToAll(0xFF0000FF, string, 1);
return 1;
}
}
else ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}K-RCON by {33CCFF}Kevin Burke/KevinExec", "Change Hostname\nChange Mapname\nChange URL\nLock/Unlock Server\nRCON Password", "Select", "Close");
}
if(dialogid == 6)
{
if(response)
{
new string[128];
SendRconCommand("password");
server_passworded = false;
SetTimer("GameModeInitExitFunc", 30000, false);
format(string, sizeof(string), "SERVER: %s has unlocked the server. Restarting in 30 seconds.", GetName(playerid));
SendClientMessageToAll(0xFF0000FF, string, 1);
return 1;
}
else ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}K-RCON by {33CCFF}Kevin Burke/KevinExec", "Change Hostname\nChange Mapname\nChange URL\nLock/Unlock Server\nRCON Password", "Select", "Close");
}
if(dialogid == 7)
{
if(response)
{
if(!inputtext[0])
{
new string[128];
format(string, sizeof(string), "RCON password: %s\n\nIf you wish to change the RCON password, enter the new one below.", GetName(playerid), rcon);
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_INPUT, "New RCON password", string, "Proceed", "Close");
return 1;
}
else
{
new string[128];
format(string, sizeof(string), "rcon_password %s", inputtext);
SendRconCommand(string);
format(rcon, sizeof(rcon));
format(string, sizeof(string), "SERVER: %s has changed the RCON password.", GetName(playerid));
SendClientMessageToAll(0xFF0000FF, string, 100000);
return 1;
}
}
else ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}K-RCON by {33CCFF}Kevin Burke/KevinExec", "Change Hostname\nChange Mapname\nChange URL\nLock/Unlock Server\nRCON Password", "Select", "Close");
}
}
}
return 1;
}
stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}


