making menu
#1

im trying to make a menu but i get theses erroes can someone please help me this is how im doing it

Top Of Script
Код:
new Menu:menuDM;
public ongamemodeint();
Код:
menuDM = CreateMenu("DM menu", 1, 50.0, 180.0, 200.0, 200.0);

AddMenuItem(menuDM, 0, "/dildoDM");
AddMenuItem(menuDM, 0, "/rocketDM");
AddMenuItem(menuDM, 0, "/sniperDM");
AddMenuItem(menuDM, 0, "/katanaDM");
AddMenuItem(menuDM, 0, "/smgDM");
AddMenuItem(menuDM, 0, "/akDM");
AddMenuItem(menuDM, 0, "/tennisDM");
AddMenuItem(menuDM, 0, "/tankDM");
AddMenuItem(menuDM, 0, "/boxDM");
AddMenuItem(menuDM, 0, "/bowlDM");
AddMenuItem(menuDM, 0, "/sumoDM");
AddMenuItem(menuDM, 0, "/townDM");
OnPlayerExitedMenuRow
Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:current;
  current = GetPlayerMenu(playerid);
  if(current == menuDM)
  {
    switch(row)
    {
      case 0:{
        	}

	if (strcmp(cmdtext, "/smgDM",true)==0)
	{
		ResetPlayerWeapons(playerid);
    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		SetPlayerDMSpawn(playerid);
		GivePlayerWeapon(playerid, 10, 1);
		DMzone[playerid] = 1;
    pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		SetPlayerInterior(playerid, 0);
		new name[MAX_PLAYER_NAME+1];
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), ********************", name);
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);
	}

      }
      case 1:{

		ResetPlayerWeapons(playerid);
		SetPlayerDMSpawn2(playerid);
    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		GivePlayerWeapon(playerid, 36, 50);
		DMzone[playerid] = 1;
    pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		SetPlayerInterior(playerid, 0);
		new name[MAX_PLAYER_NAME+1];
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "**************************", name);
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);
			}
	return 1;
      }
      case 2:{

		ResetPlayerWeapons(playerid);
		SetPlayerDMSpawn4(playerid);
    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		GivePlayerWeapon(playerid, 34, 50);
    pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		DMzone[playerid] = 1;
		SetPlayerInterior(playerid, 0);
		new name[MAX_PLAYER_NAME+1];
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "******************", name);
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);
	}
	return 1;
      }
      case 3:{

		ResetPlayerWeapons(playerid);
		SetPlayerDMSpawn5(playerid);
		GivePlayerWeapon(playerid, 8, 1);
    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
    pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		DMzone[playerid] = 1;
		SetPlayerInterior(playerid, 0);
		new name[MAX_PLAYER_NAME+1];
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "%s has joined ***********DM , ***************to join", name);
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);
		
      }
      case 4:{

		ResetPlayerWeapons(playerid);
		SetPlayerDMSpawn3(playerid);
    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		GivePlayerWeapon(playerid, 29, 5000);
		SetPlayerArmour(playerid, 100.0);
    pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		DMzone[playerid] = 1;
		SetPlayerInterior(playerid, 0);
		new name[MAX_PLAYER_NAME+1];
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "%s has joined **********DM , type ***********to join", name);
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);
		
      }
      case 5:{

		ResetPlayerWeapons(playerid);
		SetPlayerDMSpawn6(playerid);
    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		GivePlayerWeapon(playerid, 30, 550);
		DMzone[playerid] = 1;
    pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		SetPlayerInterior(playerid, 0);
		new name[MAX_PLAYER_NAME+1];
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "%s has joined ****, type /************** to join", name);
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);
		
      }
      case 6:{

		ResetPlayerWeapons(playerid);
		SetPlayerDMSpawn7(playerid);
		GivePlayerWeapon(playerid, 16, 100);
    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		DMzone[playerid] = 1;
		pMoney[playerid] = GetPlayerMoney(playerid);
    pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		SetPlayerInterior(playerid, 0);
		new name[MAX_PLAYER_NAME+1];
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), ******************to join", name);
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);

      }
      case 7:{

		new name[MAX_PLAYER_NAME+1];
    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		DMzone[playerid] = 1;
		SetPlayerInterior(playerid,10);
		ResetPlayerWeapons(playerid);
		SetPlayerDMSpawn8(playerid);
    pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "%s has joined RC Tank DM , type /tankDM to join", name);
		SendClientMessage(playerid, COLOR_YELLOW, "Take a Tank & Press <Fire> Button to Shoot & Destroy the Opponents");
		SendClientMessage(playerid, COLOR_YELLOW, "Type /**or /**to leave the DM at anytime");
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);
		
      }
      case 8:{

		new name[MAX_PLAYER_NAME+1];
    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		DMzone[playerid] = 1;
		pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		SetPlayerInterior(playerid,5);
		SetPlayerPos(playerid,***********************);
		ResetPlayerWeapons(playerid);
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), **************************", name);
		SendClientMessage(playerid, COLOR_YELLOW, "***him a good Fight");
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);
		
      }
      case 9:{

		new name[MAX_PLAYER_NAME+1];

		DMzone[playerid] = 1;

    HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		SetPlayerInterior(playerid,15);
    pColor[playerid] = GetPlayerColor(playerid);
		SetPlayerColor(playerid,0x63AFF00A);
		SetPlayerPos(playerid********************************);
		ResetPlayerWeapons(playerid);
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string***********************", name);
		SendClientMessage(playerid, COLOR_YELLOW, "!! Run for a Car !!");
		SendClientMessageToAll(COLOR_GREENISHGOLD,string);
		
      }
      case 10:{

		new name[MAX_PLAYER_NAME+1];

		DMzone[playerid] = 1;
		HasAntifall[playerid] = 0; SetTimerEx("EnableAntifall",5000,0,"i",playerid);
		SetPlayerInterior(playerid,16);
		SetPlayerPos(playerid***************************8);
		ResetPlayerWeapons(playerid);
    pColor[playerid] = GetPlayerColor(playerid);



all the ************* parts are just to cover my place of menu so cant be copied erm i get these arroes can someone maybe no what it is????

Код:
C:\Documents and Settings\***********.\My Documents\***********.***********.\gamemodes\***********..pwn(457) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\***********.\My Documents\***********.\gamemodes\***********..pwn(10246) : error 002: only a single statement (or expression) can follow each "case"
C:\Documents and Settings\***********.\My Documents\***********.\gamemodes\***********..pwn(10246 -- 10247) : error 029: invalid expression, assumed zero
C:\Documents and Settings\***********.\My Documents\***********.\gamemodes\***********..pwn(10261) : error 014: invalid statement; not in switch
C:\Documents and Settings\***********.\My Documents\***********.\gamemodes\***********..pwn(10261) : warning 215: expression has no effect
C:\Documents and Settings\***********.\My Documents\***********.\gamemodes\***********..pwn(10261) : error 001: expected token: ";", but found ":"
C:\Documents and Settings\***********.\My Documents\***********.\gamemodes\***********..pwn(10261) : error 029: invalid expression, assumed zero***********.
C:\Documents and Settings\***********.\My Documents\***********.\gamemodes\***********.pwn(10261) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#2

nice all those ********************* lol hope someone can help you... as im very busy mate
Reply
#3

you never told us which lines contains the errors. Why have you got your OnPlayerSelectedMenuRow callback inside the OnPlayerExitedMenuRow callback? To make it worse, inside OnPlayerSelectedMenuRow you have a /smgDM command.

Take the /smgDM out of there and place it under OnPlayerCommandText. Also take out OnPlayerSelectedMenuRow out of OnPlayerExitedMenuRow.

Good luck.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)