Hi, i'm trying to make one plugin that delete some model from map and save it, for the model not appear again ! My code in moment!
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#define PLUGIN_VERSION "v1.1"
public Plugin:myinfo =
{
name = "Deletar modelos do mapa",
author = "hu3br",
description = "Delet models from map and save",
version = PLUGIN_VERSION,
};
public OnPluginStart()
{
RegAdminCmd("sm_test", teste, ADMFLAG_GENERIC);
HookEvent("round_start", Event_RoundStart);
}
public Action:teste(client,args)
{
if(client == 0)
{
PrintToServer("%t","Command is in-game only");
return;
}
Modelos(client);
}
public Action:Modelos(client)
{
new Handle:menu = CreateMenu(Aimtargethandler);
SetMenuTitle(menu, "Deletar modelo");
AddMenuItem(menu, "option1", "Deletar modelo no aim");
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
return Plugin_Handled;
}
public Aimtargethandler(Handle:menu, MenuAction:action, client, itemNum)
{
if ( action == MenuAction_Select )
{
new String:info[32];
GetMenuItem(menu, itemNum, info, sizeof(info));
if ( strcmp(info,"option1") == 0 )
{
Modelos(client);
int target = GetClientAimTarget(client, false);
AcceptEntityInput(target, "Kill");
}
}
}
public Action Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
{
// ... ???
}
Thanks