AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Correct Way To Show Menu/Msg To Owner & Target? (https://forums.alliedmods.net/showthread.php?t=215375)

Blizzard_87 05-07-2013 05:48

Correct Way To Show Menu/Msg To Owner & Target?
 
Code:
    new Title[ 101 ], szName[ 32 ]; get_user_name( id, szName, 31 );     formatex( Title, 100, "Do You Accept ( \r%s\y ) Donation From \r%s\y", Desc, szName );     new menu = menu_create( Title, "Donate_Handler" );         menu_additem( menu, "I Accept The Donation", "1", 0 );     menu_additem( menu, "I Dont Accept", "2", 0 );         menu_display( g_iDonTarget, menu, 0 );     return PLUGIN_HANDLED; } public Donate_Handler( id, menu, item ) {     new szName[ 32 ]; get_user_name( g_iDonTarget, szName, 31 );     if( item == MENU_EXIT )     {         Color( id, "%s !t%s!n Declined Your !gDonation!n",PREFIX, szName );         menu_destroy( menu );         return PLUGIN_HANDLED;     }

this is spose to show menu to Target, if Target Declined or exits menu its spose to then show msg to Doner that they declined the Donation.

is this the correct way... i test on my lan server and only with me and it works... but since im same person it would work.. i would like to know if this would work the way i want it to ?

this is for my rewrite of my latest plugin.

hornet 05-07-2013 07:52

Re: Correct Way To Show Menu/Msg To Owner & Target?
 
This doesn't make any sense. Your sending the donation message to the player who sees the menu. You also send the 3rd and 4th parameters of menu_additem() but you don't use them ... Instead you could use them to hold the userid of the donating player, and then retrieve it.

Blizzard_87 05-07-2013 08:39

Re: Correct Way To Show Menu/Msg To Owner & Target?
 
its ok i figured out what i was doing wrong.


All times are GMT -4. The time now is 10:46.

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