Raised This Month: $ Target: $400
 0% 

Server vote


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sensai
Junior Member
Join Date: Mar 2010
Old 03-07-2010 , 08:57   Server vote
Reply With Quote #1

Hello,

Im new here and new to scripting.

I made a Menu where people can vote if they like the server or not.
But how can i make a command to open the menu and a something that counts the votes ?



Here is my Menu code :

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new mServerRate // Menu
new mcbServerRate // Menu Callback
 
public plugin_init() {
/* Menu Server Rate */
/* Use menu_display(id, mServerRate, 0) to show the menu to an user. */
mServerRate menu_create("Server Rate""mh_ServerRate")
mcbServerRate menu_makecallback("mcb_ServerRate")
menu_additem(mServerRate"Bad""ma_ServerRate"ADMIN_USERmcbServerRate)
menu_additem(mServerRate"Normal""ma_ServerRate"ADMIN_USERmcbServerRate)
menu_additem(mServerRate"Awesome !""ma_ServerRate"ADMIN_USERmcbServerRate)
/* Menu End */
register_plugin(PLUGINVERSIONAUTHOR)
 
// Add your code here...
}
 
/* Menu Server Rate */
public mh_ServerRate(idmenuitem) {
/* This event is called when someone presses a key on this menu */
}
public 
ma_ServerRate(id) {
/* This event is called when an item was selected */
}
public 
mcb_ServerRate(idmenuitem) {
/* This is the callback-event, here you can set items enabled or disabled. */
/* If you want to enable an item, use: return ITEM_ENABLED */
/* If you want to disable an item, use: return ITEM_DISABLED */
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1043\\ f0\\ fs16 \n\\ par }
*/ 
Thanks for reading.

Last edited by Sensai; 03-07-2010 at 10:26.
Sensai is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-07-2010 , 11:54   Re: Server vote
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=46364

BTW, ma_ServerRate(id) is never called. The data that goes in that spot is data which you want passed to the menu hanlder (mh_ServerRate(id,menu,item))
__________________

Last edited by fysiks; 03-07-2010 at 11:56.
fysiks is offline
Reply



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 08:43.


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