Menu is ocsionaly crashing my server :O HELP PLEASE - 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: Menu is ocsionaly crashing my server :O HELP PLEASE (
/showthread.php?tid=92413)
Menu is ocsionaly crashing my server :O HELP PLEASE -
[mad]MLK - 19.08.2009
Код:
ok so i got told to change my menu as it used to always crash the server
now sometimes it dose and sometimes it dosent here is my menu code:
[cod NRGSTUNTS = CreateMenu("Nrg Stunts", 1, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(NRGSTUNTS, 0, "NRG STUNT 1");
AddMenuItem(NRGSTUNTS, 0, "NRG STUNT 2");
AddMenuItem(NRGSTUNTS, 0, "NRG STUNT 3");e]
Код:
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == NRGSTUNTS)
{
switch(row)
{
case 0: //Groove nrg
{
SetPlayerPos(playerid, 2493.9133, -1682.3986, 13.3382);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to NRG-Stunt 1 by Linx");
}
case 1: //Neer river nrg
{
SetPlayerPos(playerid, -194.7351,-68.9516,3.1172);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to NRG-Stunt 2 by [mad]mlk");
}
case 2: //Wheel Arch Angels
{
SetPlayerPos(playerid, -2705.5503, 206.1621, 4.1797);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the NRG-Stunt 3 by");
}
}
}
return 1;
}
Re: Menu is ocsionaly crashing my server :O HELP PLEASE -
[mad]MLK - 19.08.2009
Re: Menu is ocsionaly crashing my server :O HELP PLEASE -
Eazy_Efolife - 19.08.2009
First off:
put this on top of script
Код:
NRGSTUNTS = CreateMenu("Nrg Stunts", 1, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(NRGSTUNTS, 0, "NRG STUNT 1");
AddMenuItem(NRGSTUNTS, 0, "NRG STUNT 2");
AddMenuItem(NRGSTUNTS, 0, "NRG STUNT 3");
Код:
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == NRGSTUNTS)
{
switch(row)
{
case 0: //Groove nrg
{
SetPlayerPos(playerid, 2493.9133, -1682.3986, 13.3382);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to NRG-Stunt 1 by Linx");
}
case 1: //Neer river nrg
{
SetPlayerPos(playerid, -194.7351,-68.9516,3.1172);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to NRG-Stunt 2 by [mad]mlk");
}
case 2: //Wheel Arch Angels
{
SetPlayerPos(playerid, -2705.5503, 206.1621, 4.1797);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to the NRG-Stunt 3 by");
}
}
}
return 1;
}
Try the code and tell me the outcomes!
Re: Menu is ocsionaly crashing my server :O HELP PLEASE -
[mad]MLK - 19.08.2009
it is at the top of the script just i would of thought that you would of asumed that :P
Re: Menu is ocsionaly crashing my server :O HELP PLEASE -
Djiango - 19.08.2009
Hint. Count your brackets.
Also, it's along time since i've made menus.
But shouldn't it be done like this?
AddMenuItem(NRGSTUNTS, 0, "NRG STUNT 1");
AddMenuItem(NRGSTUNTS,
1, "NRG STUNT 2");
AddMenuItem(NRGSTUNTS,
2, "NRG STUNT 3");