Menuscript problems
#1

I got problems with my teleporting menu, when i compile it says:

(70) : warning 217: loose indentation
(70) : error 029: invalid expression, assumed zero
(70) : warning 215: expression has no effect
(70) : error 001: expected token: ";", but found "if"
(89) : warning 217: loose indentation
(89) : error 029: invalid expression, assumed zero
(89) : warning 215: expression has no effect
(89) : error 001: expected token: ";", but found "if"
(112) : warning 217: loose indentation
(112) : warning 217: loose indentation
(117) : error 029: invalid expression, assumed zero
error 004: function "OnPlayerExitedMenu" is not implemented
error 030: compound statement not closed at the end of file (started at line 57)


7 Errors.


I'll show you a part of the script and maybe you can figure it out?
Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu (playerid);
if(CurrentMenu == Duel)
{
	switch(row)
	{
		case 0: //RW Menu
		{
			ShowMenuForPlayer(RW, playerid);
			TogglePlayerControllable(playerid,0);
		}
		case 1: //WW Menu
		{
			ShowMenuForPlayer(WW, playerid);
			TogglePlayerControllable(playerid,0);
		}
}
else if(CurrentMenu == RW)
{
	switch(row)
	{
		case 0: //come-a-lot
		{
			TogglePlayerControllable(playerid,1);
			SetPlayerPos(playerid, 2196.8206,1110.9279,26.7031);
			SetPlayerInterior(playerid, 0);
			SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to Come-a-lot");
		}
		case 1: //underground
		{
			TogglePlayerControllable(playerid,1);
			SetPlayerPos(playerid, 2489.5535,2397.2041,4.2109);
			SetPlayerInterior(playerid, 0);
			SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Underground Zone");
		}
}
else if(CurrentMenu == WW)
{
	switch(row)
	{
		case 0: //area1
		{
			TogglePlayerControllable(playerid,1);
			SetPlayerPos(playerid, 2383.0542,1145.2390,34.2529);
			SetPlayerInterior(playerid, 0);
			SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Northern WW");
		}
		case 1: //area2
		{
			TogglePlayerControllable(playerid,1);
			SetPlayerPos(playerid, 2383.4878,1121.0552,34.2529);
			SetPlayerInterior(playerid, 0);
			SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Southern WW");
		}
	}
}
return 1;
}

public OnPlayerExitedMenu(playerid)
{
  TogglePlayerControllable(playerid,1);
	return 1;
}
Reply
#2

#include <a_samp> ?
Reply
#3

I have that. this is the last part that is showing errors.
Reply
#4

Sorry for double post..

is this some new part in samp 0.3?
it seems like i can't write else if.
Reply
#5

You had 2 brackets missing.

pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
    new Menu:CurrentMenu = GetPlayerMenu (playerid);
    if(CurrentMenu == Duel)
    {
        switch(row)
        {
            case 0: //RW Menu
            {
                ShowMenuForPlayer(RW, playerid);
                TogglePlayerControllable(playerid,0);
            }
            case 1: //WW Menu
            {
                ShowMenuForPlayer(WW, playerid);
                TogglePlayerControllable(playerid,0);
            }
        }
    } // this bracket was missing
    else if(CurrentMenu == RW)
    {
        switch(row)
        {
            case 0: //come-a-lot
            {
                TogglePlayerControllable(playerid,1);
                SetPlayerPos(playerid, 2196.8206,1110.9279,26.7031);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to Come-a-lot");
            }
            case 1: //underground
            {
                TogglePlayerControllable(playerid,1);
                SetPlayerPos(playerid, 2489.5535,2397.2041,4.2109);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Underground Zone");
            }
        }
    } // this bracket was missing
    else if(CurrentMenu == WW)
    {
        switch(row)
        {
            case 0: //area1
            {
                TogglePlayerControllable(playerid,1);
                SetPlayerPos(playerid, 2383.0542,1145.2390,34.2529);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Northern WW");
            }
            case 1: //area2
            {
                TogglePlayerControllable(playerid,1);
                SetPlayerPos(playerid, 2383.4878,1121.0552,34.2529);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the Southern WW");
            }
        }
    }
    return 1;
}
Reply
#6

Solved. Thanks for reply.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)