[Help] Player Menu Crashes
#1

I have made player menu with the help of SAMP tutorial for changing and buying clothes. But after changing or buying clothes if i use ALT+TAB to minimize the game and then when i try to maximize the game, the game crashes. Any solution? i have made player menu for Carlitos Roleplay
Reply
#2

Quote:
Originally Posted by Lastman
I have made player menu with the help of SAMP tutorial for changing and buying clothes. But after changing or buying clothes if i use ALT+TAB to minimize the game and then when i try to maximize the game, the game crashes. Any solution? i have made player menu for Carlitos Roleplay
It has nothing with menu, it's your computer problem though, I don't have it. But some people do.
Reply
#3

wen i try making my own menu
it comes with a large list of errors, once i compile it
i followed the menu tutorial, and it showed all those errors
Reply
#4

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by Lastman
I have made player menu with the help of SAMP tutorial for changing and buying clothes. But after changing or buying clothes if i use ALT+TAB to minimize the game and then when i try to maximize the game, the game crashes. Any solution? i have made player menu for Carlitos Roleplay
It has nothing with menu, it's your computer problem though, I don't have it. But some people do.
Found the problem. It crashes only if i minimize while im in Interior.

Quote:
Originally Posted by Drift_King786
wen i try making my own menu
it comes with a large list of errors, once i compile it
i followed the menu tutorial, and it showed all those errors
No it works fine. Follow it from the first point to the last.
Reply
#5

done
now problem is that the command that i have assigned for the menu
PROBLEM: when i type the command that has been assigned for the menu does not work
i have put the whole thing in a filterscript
after several attempts on fixing, i try compiling
and the compiler crashes
any help?

pawn Код:
#include <a_samp>


new Menu:occupation;
new Menu:CurrentMenu = GetPlayerMenu(playerid);

public OnGameModeInit()
{
occupation = CreateMenu("occupation", 2, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(teleportmenu, 0, "LSPD");
AddMenuItem(teleportmenu, 0, "SFPD");
AddMenuItem(teleportmenu, 0, "LVPD");
AddMenuItem(teleportmenu, 0, "BCPD");
AddMenuItem(teleportmenu, 0, "BCPD");
AddMenuItem(teleportmenu, 0, "SAPD");

AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
if(CurrentMenu == occupation)
{
  switch(row)
  {
    case 0: //LSPD
    {
        SetPlayerSkin( playerid, 280 );
      SendClientMessage(playerid, 0xFFFFFFFF, "You are now in Los Santos Police");
    }
    case 1: //SFPD
    {
        SetPlayerSkin( playerid, 281 );
      SendClientMessage(playerid, 0xFFFFFFFF, "You are now in San Fierro Police");
    }
    case 2: //LVPD
    {
        SetPlayerSkin( playerid, 282 );
      SendClientMessage(playerid, 0xFFFFFFFF, "You are now in Las Venturas Police");
    }
    case 3: //BCPD
    {
        SetPlayerSkin( playerid, 283 );
      SendClientMessage(playerid, 0xFFFFFFFF, "You are now in Bone County Police");
    }
    case 4: //BCPD
    {
        SetPlayerSkin( playerid, 288 );
      SendClientMessage(playerid, 0xFFFFFFFF, "You are now in Bone County Police");
    }
    case 5: //SAPD
    {
    SetPlayerSkin( playerid, 284 );
      SendClientMessage(playerid, 0xFFFFFFFF, "You are now in San Andreas Police");
    }
  }
}
    return 1;
}

public OnPlayerCommandText(playerid)
}
    if(strcmp(cmdtext, "/select", true) == 0)
{
  ShowMenuForPlayer(occupation,playerid);
  return 1;
}
#endif
Reply
#6

AddMenuItem(teleportmenu, 0, "LSPD");
AddMenuItem(teleportmenu, 0, "SFPD");
AddMenuItem(teleportmenu, 0, "LVPD");
AddMenuItem(teleportmenu, 0, "BCPD");
AddMenuItem(teleportmenu, 0, "BCPD");
AddMenuItem(teleportmenu, 0, "SAPD");

AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");
AddMenuItem(teleportmenu, 1, "select");

Where did you have new Menu: teleportmenu ?

LE: is this a joke 'new Menu:CurrentMenu = GetPlayerMenu(playerid);' ?
Reply
#7

you made New menu to occupation so just replace teleport menu with occupation ..
Reply
#8

tried
it crashes the compiler still
Reply
#9

[font=courier new]See driftking, the tutorial given on samp wiki works. Before you try to modify it according to your own idea. Just try to copy paste the code inside your game mode at proper places. Once it works. Then go on and modify it.

-Lastman
_________________________________________________
[font=courier new]Insert this line after the #includes, #defines, forwards etc:
Код:
new Menu:teleportmenu;
Type this into OnGameModeInit():
Код:
teleportmenu = CreateMenu("Teleportmenu", 2, 200.0, 100.0, 150.0, 150.0);
So we add under the CreateMenu:
Код:
AddMenuItem(teleportmenu, 0, "LS");
AddMenuItem(teleportmenu, 0, "LS");
AddMenuItem(teleportmenu, 0, "SF");
AddMenuItem(teleportmenu, 0, "SF");
AddMenuItem(teleportmenu, 0, "LV");
AddMenuItem(teleportmenu, 0, "LV");
 
AddMenuItem(teleportmenu, 1, "Grove Street");
AddMenuItem(teleportmenu, 1, "Starfish Tower");
AddMenuItem(teleportmenu, 1, "Wheel Arch Angels");
AddMenuItem(teleportmenu, 1, "Jizzys");
AddMenuItem(teleportmenu, 1, "4 Dragons");
AddMenuItem(teleportmenu, 1, "Come-a-Lot");
OnPlayerSelectedMenuRow(playerid, row)
Код:
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == teleportmenu)
{
  switch(row)
  {
    case 0: //Grove Street
    {
      SetPlayerPos(playerid, 2493.9133, -1682.3986, 13.3382);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to Grove Street");
    }
    case 1: //Starfish Tower
    {
      SetPlayerPos(playerid, 1541.2833, -1362.4741, 329.6457);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the top of Starfish Tower");
    }
    case 2: //Wheel Arch Angels
    {
      SetPlayerPos(playerid, -2705.5503, 206.1621, 4.1797);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Wheel Arch Angels tuning-shop");
    }
    case 3: //Jizzys
    {
      SetPlayerPos(playerid, -2617.5156, 1390.6353, 7.1105);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to Jizzy's Nightclub!");
    }
    case 4: //4Dragons
    {
      SetPlayerPos(playerid, 2028.5538, 1008.3543, 10.8203);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Four Dragons Casino");
    }
    case 5: //Com-a-Lot
    {
      SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107);
      SetPlayerInterior(playerid, 0);
      SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Come-a-Lot casino!");
    }
  }
}
ShowMenuForPlayer
Код:
if(strcmp(cmdtext, "/teleport", true) == 0)
{
  ShowMenuForPlayer(teleportmenu,playerid);
  return 1;
}
OnPlayerExitedMenu(playerid)
Код:
public OnPlayerExitedMenu(playerid)
{
  TogglePlayerControllable(playerid, 1);
	return 1;
}
Reply
#10

ok
no more crashes
only errors
pawn Код:
#include <a_samp>



new Menu:occupation;


public OnGameModeInit();

    occupation = CreateMenu("occupation", 2, 200.0, 100.0, 150.0, 150.0);
    AddMenuItem(occupation, 0, "LSPD");
    AddMenuItem(occupation, 0, "SFPD");
    AddMenuItem(occupation, 0, "LVPD");
    AddMenuItem(occupation, 0, "BCPD");
    AddMenuItem(occupation, 0, "BCPD");
    AddMenuItem(occupation, 0, "SAPD");
    AddMenuItem(occupation, 1, "select");
    AddMenuItem(occupation, 1, "select");
    AddMenuItem(occupation, 1, "select");
    AddMenuItem(occupation, 1, "select");
    AddMenuItem(occupation, 1, "select");
    AddMenuItem(occupation, 1, "select");
}
        return;
}

public OnPlayerSelectedMenuRow(playerid, row)
new Menu:CurrentMenu = GetPlayerMenu(playerid);
{
    if(CurrentMenu == occupation)
{
        switch(row)
{
            case 0: //LSPD
            {
                SetPlayerSkin( playerid, 280 );
                SendClientMessage(playerid, 0xFFFFFFFF, "You are now in Los Santos Police");
            }
            case 1: //SFPD
            {
                SetPlayerSkin( playerid, 281 );
                SendClientMessage(playerid, 0xFFFFFFFF, "You are now in San Fierro Police");
            }
            case 2: //BCPD
            {
                SetPlayerSkin( playerid, 282 );
                SendClientMessage(playerid, 0xFFFFFFFF, "You are now in Las Venturas Police");
            }
            case 3: //BCPD
            {
                SetPlayerSkin( playerid, 283 );
                SendClientMessage(playerid, 0xFFFFFFFF, "You are now in Bone County Police");
            }
            case 4: //BCPD
            {
                SetPlayerSkin( playerid, 288 );
                SendClientMessage(playerid, 0xFFFFFFFF, "You are now in Bone County Police");
            }
            case 5: //SAPD
            {
                SetPlayerSkin( playerid, 284 );
                SendClientMessage(playerid, 0xFFFFFFFF, "You are now in San Andreas Police");
            }
        }
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/select", true) == 0)
{
        ShowMenuForPlayer(occupation, playerid);
        return;
}
}
public OnPlayerExitedMenu(playerid)
{
  TogglePlayerControllable(playerid, 1);
    return 1;
}
#endif

here are the errors that are given
Код:
(10) : error 010: invalid function or declaration
(24) : error 010: invalid function or declaration
(28) : error 003: declaration of a local variable must appear in a compound block
(30) : error 010: invalid function or declaration
(32) : error 010: invalid function or declaration
(34) : error 010: invalid function or declaration
(39) : error 010: invalid function or declaration
(44) : error 010: invalid function or declaration
(49) : error 010: invalid function or declaration
(54) : error 010: invalid function or declaration
(59) : error 010: invalid function or declaration
(66) : error 010: invalid function or declaration
(82) : error 026: no matching "#if..."
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


13 Errors.
its sorta easy and confusing at the same time
:P :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)