SA-MP Forums Archive
Need Help - 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: Need Help (/showthread.php?tid=227383)



Need Help - Ironboy - 17.02.2011

I Want to add "AddMenuItem"
I checked samp wiki but i didnt understood .can anyone plz help me with complete details?


Re: Need Help - Ironboy - 17.02.2011

plz help me


Re: Need Help - LZLo - 17.02.2011

F_Menu or just simple?

F_menu.inc - http://forum.sa-mp.com/showthread.ph...ghlight=f_menu

simple:
PHP код:
new MenuYourMenu
in F_menu:
PHP код:
new YourMenu
under ongamemodeinit:
simple:
PHP код:
Teleports CreateMenu("YourMenu"118.0102.0165.0165.0);
    
AddMenuItem(YourMenu0"YourMenu1");
    
AddMenuItem(YourMenu0"YourMenu2");
    
AddMenuItem(YourMenu0"YourMenu3");[/QUOTE]
in F_menu:
[
QUOTE]YourMenu CreateMenu("YourMenu"20.0120.0200.0);
    
F_AddMenuItem(YourMenu"YourMenu1");
    
F_AddMenuItem(YourMenu"YourMenu2");
    
F_AddMenuItem(YourMenu"YourMenu3"); 
under ongamemodeexit:
simple:
PHP код:
DestroyMenu(YourMenu); 
F_Menu
PHP код:
F_DestroyMenu(YourMenu); 
new public
simple:
PHP код:
public OnPlayerSelectedMenuRow(playeridrow)
{
    new 
Menu:CurrentMenu GetPlayerMenu(playerid);
    if(
CurrentMenu == YourMenu)
    {
        switch(
row)
        {
            case 
0//YourMenu1
            
{
                /
SOMETHING
                       
}
            case 
1//YourMenu2
            
{
                
//SOMETHING
                       
}
            case 
2//YourMenu3
            
{
                
//SOMETHING
                       
}
        }
    }
    return 
1;
}
public 
OnPlayerExitedMenu(playerid)
{
    new 
Menu:CurrentMenu GetPlayerMenu(playerid);
    if(
Menu:CurrentMenu == YourMenu)
    {
        
TogglePlayerControllable(playerid1);
    }
    return 
1;

F_Menu:
PHP код:
public F_OnPlayerSelectedMenuRow(playeridmenuidrow)
{
    if(
menuid == YourMenu)
    {
        switch(
row)
        {
            case 
0//YourMenu1
            
{
                
//SOMETHING
            
}
            case 
1//YourMenu2
            
{
                
//SOMETHING
            
}
            case 
2//YourMenu3
            
{
                
//SOMETHING
            
}
        }
    }
    return 
1;
}
public 
F_OnPlayerExitedMenu(playeridmenuid)
{
    
//new Menu:CurrentMenu = GetPlayerMenu(playerid);
    
if(menuid == YourMenu)
    {
        
TogglePlayerControllable(playerid1);
    }
    return 
1;

and add the shows and done!


Re: Need Help - Ironboy - 18.02.2011

ok thank you very much


Re: Need Help - jejemonerz123 - 18.02.2011

lol wonder when i will be a pro scripter XD


Re: Need Help - HyperZ - 18.02.2011

Also read the wiki:
https://sampwiki.blast.hk/wiki/CreateMenu
https://sampwiki.blast.hk/wiki/AddMenuItem
https://sampwiki.blast.hk/wiki/OnPlayerSelectedMenuRow

@LZLo
Use [pawn] [/ pawn] Without that space.


Re: Need Help - Ironboy - 18.02.2011

ok ty xD


Re: Need Help - Ironboy - 18.02.2011

i did that but it shows like this
pawn Код:
C:\Documents and Settings\Ironboy\Desktop\Windows server\gamemodes\Paradise_City.pwn(242) : error 017: undefined symbol "Teleports"
C:\Documents and Settings\Ironboy\Desktop\Windows server\gamemodes\Paradise_City.pwn(2554) : error 036: empty statement
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
after that i added

pawn Код:
new Menu:Teleports
and it shows like this
pawn Код:
C:\Documents and Settings\Ironboy\Desktop\Windows server\gamemodes\Paradise_City.pwn(2555) : error 036: empty statement
C:\Documents and Settings\Ironboy\Desktop\Windows server\gamemodes\Paradise_City.pwn(243) : warning 204: symbol is assigned a value that is never used: "Teleports"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
how to fix it?


Re: Need Help - Ironboy - 19.02.2011

how to fix it please help me