public OnPlayerSelectedMenuRow(playerid, row);
if(CurrentMenu == teleportmenu)
{
switch(row)
{
case 0: //Desert Eagle
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 0.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 1000);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to Desert Eagle Deathmatch zone. Survive and kill your enemy's with your last weapon left, Desert Eagle.");
SetPlayerPos(playerid,-2672.5190,1410.3302,907.5703);
SetPlayerInterior(playerid, 3);
return 1;
}
case 1: //Explosion Deathmatch
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 0.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 22, 1000);
GivePlayerWeapon(playerid, 26, 1000);
GivePlayerWeapon(playerid, 32, 1000);
GivePlayerWeapon(playerid, 37, 10000);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to Explosion Deathmatch. Try to survive and kill your enemy's!");
SetPlayerPos(playerid,2038.2716,-1995.2430,35.0158);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
case 2: //Baseball
{
SetPlayerHealth(playerid, 2.0);
SetPlayerArmour(playerid, 0.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 5, 1);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to the Baseball Field. Kill your enemy's with your Baseball Bat!");
SetPlayerPos(playerid, 1384.0188,2185.7866,11.0234);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
case 3: //Basejump
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 16, 200);
SendClientMessage(playerid, COLOR_YELLOW, "Teleport to the roof top. Blast enemy's off the building with your Grenades!");
SetPlayerPos(playerid, -1818.1145,548.4082,234.8874);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
case 4: //War Deathmatch
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 16, 2500);
GivePlayerWeapon(playerid, 35, 2500);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to War Deathmatch. Kill your enemy's and try to survive!");
SetPlayerPos(playerid, -1399.1252441406,1037.9338378906,1028.7286376953);
SetPlayerInterior(playerid, 15);
return 1;
}
}
}
public OnPlayerSelectedMenuRow(playerid, row) { if(CurrentMenu == teleportmenu) { } return 0; }
Originally Posted by Rac3r
Code:
public OnPlayerSelectedMenuRow(playerid, row) { if(CurrentMenu == teleportmenu) { } return 0; } |
Originally Posted by $Fl@Ke$
Quote:
|
public OnPlayerSelectedMenuRow(playerid, row)
{
if(CurrentMenu == teleportmenu)
{
}
return 0;
}
switch(row)
{
case 0: //Desert Eagle
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 0.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 1000);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to Desert Eagle Deathmatch zone. Survive and kill your enemy's with your last weapon left, Desert Eagle.");
SetPlayerPos(playerid,-2672.5190,1410.3302,907.5703);
SetPlayerInterior(playerid, 3);
return 1;
}
case 1: //Explosion Deathmatch
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 0.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 22, 1000);
GivePlayerWeapon(playerid, 26, 1000);
GivePlayerWeapon(playerid, 32, 1000);
GivePlayerWeapon(playerid, 37, 10000);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to Explosion Deathmatch. Try to survive and kill your enemy's!");
SetPlayerPos(playerid,2038.2716,-1995.2430,35.0158);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
case 2: //Baseball
{
SetPlayerHealth(playerid, 2.0);
SetPlayerArmour(playerid, 0.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 5, 1);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to the Baseball Field. Kill your enemy's with your Baseball Bat!");
SetPlayerPos(playerid, 1384.0188,2185.7866,11.0234);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
case 3: //Basejump
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 16, 200);
SendClientMessage(playerid, COLOR_YELLOW, "Teleport to the roof top. Blast enemy's off the building with your Grenades!");
SetPlayerPos(playerid, -1818.1145,548.4082,234.8874);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
case 4: //War Deathmatch
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 16, 2500);
GivePlayerWeapon(playerid, 35, 2500);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to War Deathmatch. Kill your enemy's and try to survive!");
SetPlayerPos(playerid, -1399.1252441406,1037.9338378906,1028.7286376953);
SetPlayerInterior(playerid, 15);
return 1;
}
}
}
Originally Posted by Don Correlli
Because that code is not in the callback (OnPlayerSelectedMenuRow).
|
Originally Posted by Don Correlli
So learn how to script correctly. You can't have some code out of the callback/function, and amount of closing brackets needs to be equal to the amount of opening brackets.
|
Originally Posted by DarkPhoenix
I'm only asking where to put the brackets. This place is to help and not say: Learn to script or whatever, I can script.
|
public OnPlayerSelectedMenuRow(playerid, row)
{
if(CurrentMenu == teleportmenu)
{
switch(row)
{
case 0: //Desert Eagle
{
// code
}
case 1: //Explosion Deathmatch
{
//code
}
//other cases
}
}
if(CurrentMenu == othermenuHmm)
{
}
return 0;
}