Menu Question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Menu Question (
/showthread.php?tid=94140)
Menu Question -
Jbosh123 - 28.08.2009
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!
Re: Menu Question -
Paladin - 28.08.2009
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!
Re: Menu Question -
ded - 28.08.2009
Quote:
Originally Posted by Paladin
|
Dude .. did you even read what his post?
Quote:
Originally Posted by Jbosh123
|
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;