Menu Question
#1

Hello Again Guys,

I have been working on making a Menu for a roleplay server!
... Trouble is, I am a Beginner at PAWN, Ive learnt what I have learnt by looking at files, But I need to know more about menu's!

In SARP ( San Andreas Roleplay ), In the PD they have a /lspd Menu
I want that very same thing, I have an Info Icon placed infront of the Lockers where only the /lspd should work!
But I need to know how to only have the /lspd command only work at that spot!

I have read https://sampwiki.blast.hk/wiki/Creating_a_simple_Menu And I still have some trouble!

Could someone help me and like do /lspd as command and like have top command as On/Off Duty in script?
And like have test2 and test3
And where the co-ordinates are, Just do like X Y Z for where the /lspd command can only be used!

This will help heaps!
Reply
#2

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!
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)