mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-05 05:17:55 -04:00
53 lines
1.4 KiB
Plaintext
53 lines
1.4 KiB
Plaintext
//------------------------------------------------
|
|
// civic_skillteacher
|
|
//------------------------------------------------
|
|
|
|
//------------------------------------------------
|
|
// Includes
|
|
//------------------------------------------------
|
|
|
|
include library.city;
|
|
|
|
//------------------------------------------------
|
|
// Constants
|
|
//------------------------------------------------
|
|
|
|
const string_id SID_MT_REMOVE = new string_id("city/city", "mt_remove");
|
|
const string_id SID_MT_REMOVED = new string_id("city/city", "mt_removed");
|
|
|
|
//------------------------------------------------
|
|
// OnObjectMenuRequest
|
|
//------------------------------------------------
|
|
|
|
trigger OnObjectMenuRequest( obj_id player, menu_info mi )
|
|
{
|
|
int city_id = city.checkMayorCity( player, false );
|
|
if ( city_id == 0 )
|
|
return SCRIPT_CONTINUE;
|
|
|
|
mi.addRootMenu( menu_info_types.SERVER_MENU1, SID_MT_REMOVE );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//------------------------------------------------
|
|
// OnObjectMenuSelect
|
|
//------------------------------------------------
|
|
|
|
trigger OnObjectMenuSelect( obj_id player, int item )
|
|
{
|
|
int city_id = city.checkMayorCity( player, false );
|
|
if ( city_id == 0 )
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if ( item == menu_info_types.SERVER_MENU1 )
|
|
{
|
|
obj_id spawner = getObjIdObjVar( self, "spawner" );
|
|
sendSystemMessage( player, SID_MT_REMOVED );
|
|
messageTo( spawner, "requestDestroy", null, 0.f, false );
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|