Raised This Month: $ Target: $400
 0% 

Solved Format HELP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DarthMan
Veteran Member
Join Date: Aug 2011
Old 03-02-2017 , 08:15   Re: Format HELP
Reply With Quote #3

Code:
new g_thirdperson=0
new conffile_model[200]
new configdir_model[200]
new file_model[128], leng;

new g_Vault;               //Global var to hold our vault handle
new g_Vault_2;
new g_szAuthID[35];    //Global array to store auth ids of players
new g_iArraySize
new Array:g_models

public plugin_init() 
{
	register_plugin("Advanced Menu", "1,0", "DarthMan");
	register_clcmd("say menu", "ShowMenu", _, "");
	register_clcmd("say_team menu", "ShowMenu", _, "");
	get_configsdir(configdir_model,199)
	g_models = ArrayCreate(128, 32)
	fileRead()
}

fileRead()
{
	new szConfigsName[256], szFilename[256]
	get_configsdir(szConfigsName, charsmax(szConfigsName))
	formatex(szFilename, charsmax(szFilename), "%s/models.ini", szConfigsName)
	new iFilePointer = fopen(szFilename, "rt")
	
	if(iFilePointer)
	{
		new szData[128]
		
		while(!feof(iFilePointer))
		{
			fgets(iFilePointer, szData, charsmax(szData))
			trim(szData)
			
			if(szData[0] == EOS || szData[0] == ';')
				continue
				
			ArrayPushString(g_models, szData)
		}
		
		g_iArraySize = ArraySize(g_models)
		fclose(iFilePointer)
	}
}    

public mh_PMenu(id, menu, item)
{
	new szItem[128];
	if(item == MENU_EXIT)
	{
		menu_cancel(id);
		return PLUGIN_HANDLED;
	}

	new command[6], name[64], access, callback;
	//new local_models[128], local_skins[128],  lineIn[128];

	menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);

	switch(item)
	{
		case 0:
		{
		new menu_model = menu_create("Models Menu", "mh_MMenu")
		for(new i; i < g_iArraySize; i++)
		{
			ArrayGetString(g_models, i, szItem, charsmax(szItem))
			menu_additem(menu_model, szItem, "", 0)
		}
		
		menu_setprop(menu_model, MPROP_EXIT, MEXIT_ALL);
		menu_setprop(menu_model, MPROP_BACKNAME, "Back");
		menu_setprop(menu_model, MPROP_NEXTNAME, "Next");
		menu_setprop(menu_model, MPROP_EXITNAME, "Close");
		menu_destroy(menu);
		menu_display(id, menu_model, 0);
		}
		case 1:
		{
		if (g_thirdperson==0)
		    {
			client_print(id, print_chat, "You have selected Thirdperson View");
			g_thirdperson=1;
			set_view(id, CAMERA_3RDPERSON);
			return PLUGIN_CONTINUE;
		    }
		else
		    {
			client_print(id, print_chat, "You have selected Firstperson View");
			g_thirdperson=0;
			set_view(id, CAMERA_NONE);
			return PLUGIN_CONTINUE;
		    }		
		}
	}

	return PLUGIN_HANDLED;
}
DarthMan is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode