Menu Question
#3

Quote:
Originally Posted by Paladin
https://sampwiki.blast.hk/wiki/Creating_a_simple_Menu
That should give you all the information you need.
If you need IM assistance, feel free to look for me in the SA-MP Scripting IRC Channel.
IRC CHANNEL

But first read the wiki!
Dude .. did you even read what his post?

Quote:
Originally Posted by Jbosh123
I have read https://sampwiki.blast.hk/wiki/Creating_a_simple_Menu And I still have some trouble!
The wiki only gives you limited reference. Basically you need to add some kind of variable into OnPlayerPickup ... so for this example my info icon ID is called "lspd" firstly we create the variable for OnPlayerPickup at the top of the script.

Код:
new InLSPD[MAX_PLAYERS];
//Creating the variable at the top of the script

Next In OnPlayerPickup, this is what will happen when the player picks up the "lspd" info icon:

Код:
if(pickupid == lspd) {
  InLSPD[playerid] == 1;
  return 1;
  }
}
Then your command would include that variable. For example, assuming you're using dcmd (because it owns strcmp).

Код:
dcmd_lspd(playerid,params[]) {
   #pragma unused params
   if(InLSPD[playerid] == 1) {
      ShowMenuForPlayer("NAME OF YOUR MENU HERE");
   } else return SendClientMessage(playerid,COLOR,"This command can only be used in the LSPD icon!");
}
and then add the command to OnPlayerCommandText:

Код:
dcmd(lspd,4,cmdtext);
That's just a quick thing to give you an example of how it can be done.

You would also need to add this to your OnPlayerExitedMenu, OnPlayerConnect and OnPlayerDisconnect callbacks:

Код:
InLSPD[playerid] == 0;
Reply


Messages In This Thread
Menu Question - by Jbosh123 - 28.08.2009, 11:01
Re: Menu Question - by Paladin - 28.08.2009, 13:19
Re: Menu Question - by ded - 28.08.2009, 15:54

Forum Jump:


Users browsing this thread: 1 Guest(s)