Raised This Month: $ Target: $400
 0% 

passing var in menu handler (quick fix please)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-28-2014 , 09:11   Re: passing var in menu handler (quick fix please)
Reply With Quote #2

okay so I "solved" this by creating a 1dimensional array that stores the invoker's id in the position of the invoked player's cell, any better way to do this?
I've searched for documentation but couldn't find any other optional params in the show_menu command

Code:
new id = x         static menu[1000], len     len = 0     len += formatex(menu[len], charsmax(menu) - len, "\yJucatorul -\d %s\y te-a provocat la PHF pe %d Credite^n^n",szName,Miza)     len += formatex(menu[len], charsmax(menu) - len, "\y1.\w Accepta^n")     len += formatex(menu[len], charsmax(menu) - len, "\y2.\w Refuza^n")     show_menu(iPlayer, KEYSMENU, menu, -1, "Piatra hartie foarfeca")         g_phfdata[iPlayer]=id public menu_phf(id, key) {     if(cs_get_user_team(id) == CS_TEAM_T)     {         switch (key)         {             case 0:             {                 g_acceptphf[id]=true                 client_cmd(id,"spk buttons/button9")             }             case 1:             {                 g_acceptphf[id]=false                 remove_task(51373)                 g_phfinit[id]=0                                 g_phfinit[g_phfdata[id]]=0                 client_cmd(id,"spk buttons/button9")             }         }     } }

Last edited by aron9forever; 05-28-2014 at 09:16.
aron9forever 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 09:45.


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