I have a fair amount of user inputs and creating new function for every input doesn't seem good (unless it's the only way).
So is there a way to call messagemode with params?
PHP Code:
register_clcmd("iInput", "@InputInt");
//This what Im using atm
PHP Code:
@InputInt(id) {
new szText[16];
read_args(szText, charsmax(szText));
remove_quotes(szText);
g_ePlayerShop[id][Quantity] = str_to_num(szText);
@ShopMenu(id, PAGE_ONE);
return PLUGIN_HANDLED;
}
//I would like to have an extra param
PHP Code:
@InputInt(id, InputFor) {
new szText[16];
read_args(szText, charsmax(szText));
remove_quotes(szText);
switch(InputFor) {
case INPUT_SHOP: {
g_ePlayerShop[id][Quantity] = str_to_num(szText);
@ShopMenu(id, PAGE_ONE);
}
case INPUT_GIFT: {
g_ePlayerGift[id][Quantity] = str_to_num(szText);
@GiftMenu(id, PAGE_ONE);
}
case INPUT_MARKET: {
g_ePlayerMarket[id][Quantity] = str_to_num(szText);
@MarketMenu(id, PAGE_ONE);
}
}
return PLUGIN_HANDLED;
}
PHP Code:
//how do I set extra param here (if its even possible)?
client_cmd(id, "messagemode iInput");
__________________