Junior Member
|
07-28-2013
, 16:52
Se crashea el server
|
#1
|
Buenas a todos y antes que nada les pido disculpas ya que esta sección esta en la zona de amx mod pero es que yo necesito ayuda urgente de sourcemod y les agradeceria que me ayudaran...
Mi idea es crear un menu con valores preestablecidos a traves de los cuales se aplica un castigo...
este es el codigo:
Quote:
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>
#include <cstrike>
#include <clientprefs>
new Int:info[3];
new String:sInfo[24];
new iSerial;
new iID;
public Plugin:myinfo =
{
name = "Tban Plugin",
author = "Crack49 or emiliovirtual",
description = "Tban plugin for simple administration",
url = "http://www.mapeadores.com/"
};
public OnPluginStart()
{
RegAdminCmd("sm_tban", CommandTban, ADMFLAG_GENERIC);
}
public Action:CommandTban(client, args)
{
new Handle:menu = CreateMenu(MenuHandler_ClientSelect2);
SetMenuTitle(menu, "Tban Plugin");
AddMenuItem(menu, "1", "Romper Barricadas");
AddMenuItem(menu, "2", "Usar mal Materia");
AddMenuItem(menu, "3", "Insultos");
AddMenuItem(menu, "4", "Racismo");
AddMenuItem(menu, "5", "Molestar por micro");
AddMenuItem(menu, "6", "Incitar odio al Server");
AddMenuItem(menu, "7", "Sprays inaceptables");
AddMenuItem(menu, "8", "Trollear");
AddMenuItem(menu, "9", "Publicidad en el nick");
AddMenuItem(menu, "10", "Ping Alto (mas de 400)");
AddMenuItem(menu, "11", "Retry");
AddMenuItem(menu, "12", "Publicidad de otro Server");
AddMenuItem(menu, "13", "Cheats");
AddMenuItem(menu, "14", "Reincidente");
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
public MenuHandler_ClientSelect2(Handle:menu, MenuAction:action, client, item)
{
if ( action == MenuAction_Select )
{
GetMenuItem(menu, item, info, sizeof(info));
PrintToChat(client, "info es igual a %d", info);
decl String:sName[MAX_NAME_LENGTH];
decl String:sID[24];
new Handle:menucliente = CreateMenu(MenuHandler_ClientSelect);
SetMenuTitle(menucliente, "Objetivos", client);
for(new i; i <= MaxClients; i++)
{
GetClientName(i, sName, sizeof(sName));
Format(sID, sizeof(sID), "%d", GetClientSerial(i));
AddMenuItem(menucliente, sID, sName);
}
}
if(GetMenuItemCount(menucliente) < 1)
{
PrintToChat(client, "\x04[CALLADMIN]\x03 %t", "CallAdmin_NoPlayers");
CloseHandle(menucliente);
}
else
{
}
}
public MenuHandler_ClientSelect(Handle:menucliente, MenuAction:action, client, param2)
{
if(action == MenuAction_Select)
{
GetMenuItem(menucliente, param2, sInfo, sizeof(sInfo));
iSerial = StringToInt(sInfo);
iID = GetClientFromSerial(iSerial);
if(action == MenuAction_End)
{
if ( strcmp(info,"1") == 0 )
{
{
ServerCommand("sm_slay #p", iID)
}
}else if ( strcmp(info,"2") == 0 )
{
{
ServerCommand("sm_slay #p", iID)
}
}else if ( strcmp(info,"3") == 0 )
{
{
ServerCommand("sm_mute #p", iID)
}
}else if ( strcmp(info,"4") == 0 )
{
{
ServerCommand("sm_mute #p", iID)
}
}else if ( strcmp(info,"5") == 0 )
{
{
ServerCommand("sm_mute #p", iID)
}
}else if ( strcmp(info,"6") == 0 )
{
{
ServerCommand("sm_mute #p", iID)
}
}else if ( strcmp(info,"7") == 0 )
{
{
ServerCommand("sm_kick #p Spray ofensivo", iID)
}
}else if ( strcmp(info,"8") == 0 )
{
{
ServerCommand("sm_kick #p Trollear", iID)
}
}else if ( strcmp(info,"9") == 0 )
{
{
ServerCommand("sm_kick #p Publicidad en el nick", iID)
}
}else if ( strcmp(info,"10") == 0 )
{
{
ServerCommand("sm_kick #p Ping muy alto", iID)
}
}else if ( strcmp(info,"11") == 0 )
{
{
ServerCommand("sm_ban #p 30 Retry", iID)
}
}else if ( strcmp(info,"12") == 0 )
{
{
ServerCommand("sm_ban #p 1440 Publicidad de otro servidor", iID)
}
}else if ( strcmp(info,"13") == 0 )
{
{
ServerCommand("sm_ban #p 10080 Cheats", iID)
}
}else if ( strcmp(info,"14") == 0 )
{
{
ServerCommand("sm_ban #p 60 Reincidente de faltas", iID)
}
}
}
}
}
|
Lo que necesito son dos menús, el primero que seleccione la razon y se relacione a una variable numerica, a continuación se abre otro menu para targetear al objetivo, en esta parte es en la que se bugua y craseha... si me pudieran aportar alguna solucion de verdad se lo agradeceria o alguna forma mejor de crear dos menus, uno con targeteo de cliente, bueno gracias a todos un saludo...
|
|