AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Server vote (https://forums.alliedmods.net/showthread.php?t=120693)

Sensai 03-07-2010 08:57

Server vote
 
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.

fysiks 03-07-2010 11:54

Re: Server vote
 
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))


All times are GMT -4. The time now is 08:43.

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