AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Plugin fps (https://forums.alliedmods.net/showthread.php?t=209627)

joyceteamo 02-27-2013 18:40

[HELP] Plugin fps
 
someone could help me in this plugin .. not running the ta / fps or menu appears dele.ele was for a menu appears when the player connects in server
------------------------------------------------------------------------------------------------
PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "FPS Menu"
#define VERSION "1.0"
#define AUTHOR "shadow.hk"
new fpsmenu
public plugin_init()
{
register_plugin(PLUGINVERSIONAUTHOR)
register_clcmd("say /fps","showFPSmenu",0,"Brings up an FPS menu")
fpsmenu register_cvar("amx_allowfps","1")
}
public 
showFPSmenu(id)
{
if (
get_pcvar_num(fpsmenu) == 1)
{
new 
menu menu_create("\yFPS Menu","menu_handler")
menu_addblank(menu)
menu_additem(menu,"\wFPS 101","3",0)
menu_additem(menu,"\wFPS 125","4",0)
menu_additem(menu,"\wFPS 131","5",0)
menu_addblank(menu)
menu_additem(menu,"\wExit","0",0)
menu_setprop(menuMPROP_EXITMEXIT_ALL)
menu_display(idmenu0)
}
}
public 
menu_handler(id,menu,item)
{
if (
item == MENU_EXIT)
{
menu_destroy(menu)
return 
PLUGIN_HANDLED
}

new 
data[6], iName[64]
new 
accesscallback

menu_item_getinfo
(menuitemaccessdata,5iName63callback)

new 
key str_to_num(data)

switch(
key)
{
case 
3:{
client_cmd(id,"fps_max 101")
}
case 
4:{
client_cmd(id,"fps_max 125")
}
case 
5:{
client_cmd(id,"fps_max 131")

}
case 
0:{
menu_destroy(menu)
return 
PLUGIN_HANDLED
}
}
menu_destroy(menu)
return 
PLUGIN_HANDLED



fysiks 02-27-2013 21:20

Re: [HELP] Plugin fps
 
Clients can change their own fps_max in console.

Also, please speak in english so people can understand you.

oxygen935 02-28-2013 12:21

Re: [HELP] Plugin fps
 
just add this:

PHP Code:

public client_putinserver(id
{
    
menu_display(idmenu0)



joyceteamo 02-28-2013 15:30

Re: [HELP] Plugin fps
 
Quote:

Originally Posted by oxygen935 (Post 1903786)
just add this:

PHP Code:

public client_putinserver(id
{
    
menu_display(idmenu0)



could you post the sma?

I do not know add this code = /

fysiks 03-01-2013 00:40

Re: [HELP] Plugin fps
 
Quote:

Originally Posted by oxygen935 (Post 1903786)
just add this:

PHP Code:

public client_putinserver(id
{
    
menu_display(idmenu0)



That will not work. The menu does not exist yet.


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

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