PDA

View Full Version : Opening Larger Dialogs cause lag and sometimes crash server.


Dokins
05/12/2013, 02:33 PM
Could you provide me with any code you'd like to see...

Here are the main dialogs that cause lag. I have no idea why?

Command to open:

CMD:buyparts(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, -2230.5210, 2560.3955, 1.8223))
{
new dialog[300];
strcat(dialog, "Small Grip ($300)\nMedium Grip ($500)\nLarge Grip($750)\nRandom Grip Package (3) ($1,500)\nSmall Frame ($1,000)\n");
strcat(dialog, "Medium Frame ($1,500)\nLarge Frame ($2,000)\nRandom Frame Package (3)($3,000)\nSmall Barrel ($500)\nMedium Barrel ($750)\n");
strcat(dialog, "Large Barrel($1,000)\nRandom Barrel Package (3) ($2,000)");
ShowPlayerDialog(playerid, DIALOG_GUNPARTS, DIALOG_STYLE_LIST, "Illegal Gun Part Purchasing.", dialog, "Select", "Cancel");
}
return 1;
}

Dialog.

else if(dialogid == DIALOG_GUNPARTS)
{
new str[128];
if(response == 0)
{
return 1;
}
switch(listitem)
{
case 0:
{

PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(PlayerMoney[playerid] < 300)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -300);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
SGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SGrip", SGrip[playerid], "accounts");
format(str, sizeof(str), "You have purchased a Small Grip, you now have a total of %d.", SGrip[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}
case 1:
{

if(PlayerMoney[playerid] < 500)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -500);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
MGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MGrip", MGrip[playerid], "accounts");
format(str, sizeof(str), "You have purchased a Medium Grip, you now have a total of %d.", MGrip[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}
case 2:
{

if(PlayerMoney[playerid] < 750)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -750);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
LGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LGrip", LGrip[playerid], "accounts");
format(str, sizeof(str), "You have purchased a Large Grip, you now have a total of %d.", LGrip[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, str);

}
case 3://Random Package.
{
if(PlayerMoney[playerid] < 1500)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -1500);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
new rand[3];
new randStr[3][25];


for(new i = 0; i < sizeof rand; i++)
{
rand[i] = random(3);
switch(rand[i])
{
case 0:
{
format(randStr[i], 25, "Small Grip");
SGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SGrip", SGrip[playerid], "accounts");

}
case 1:
{
format(randStr[i], 25, "Medium Grip");
MGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MGrip", MGrip[playerid], "accounts");
}
case 2:
{
format(randStr[i], 25, "Large Grip");
LGrip[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LGrip", LGrip[playerid], "accounts");
}//case 2
}//switch
}//fornew
format(str, sizeof(str),"You got a {33AA33}%s{FFFFFF}, a {33AA33}%s {FFFFFF}and a {33AA33}%s {FFFFFF}from the package.", randStr[0], randStr[1], randStr[2]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}//actual case
case 4:
{

if(PlayerMoney[playerid] < 1000)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, - 1000);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
SFrame[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SFrame", SFrame[playerid], "accounts");
format(str, sizeof(str), "You have purchased a Small Frame, you now have a total of %d.", SFrame[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}
case 5:
{

if(PlayerMoney[playerid] < 1500)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -1500);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
MFrame[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MFrame", MFrame[playerid], "accounts");
format(str, sizeof(str), "You have purchased a Medium Frame, you now have a total of %d.", MFrame[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}
case 6:
{

if(PlayerMoney[playerid] < 2000)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -2000);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
LFrame[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LFrame", LFrame[playerid], "accounts");
format(str, sizeof(str), "You have purchased a Large Frame, you now have a total of %d.", LFrame[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, str);

}
case 7://Random Package.
{
if(PlayerMoney[playerid] < 3000)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -3000);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");

new rand1[3];
new randStr1[3][25];

for(new i = 0; i < sizeof rand1; i++)
{
rand1[i] = random(3);
switch(rand1[i])
{
case 0:
{
format(randStr1[i], 25, "Small Frame");
SFrame[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SFrame", SFrame[playerid], "accounts");

}
case 1:
{
format(randStr1[i], 25, "Medium Frame");
MFrame[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MFrame", MFrame[playerid], "accounts");
}
case 2:
{
format(randStr1[i], 25, "Large Frame");
LFrame[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LFrame", LFrame[playerid], "accounts");
}//case 2
}//switch
}//switch
format(str, sizeof(str),"You got a {33AA33}%s{FFFFFF}, a {33AA33}%s {FFFFFF}and a {33AA33}%s {FFFFFF}from the package.", randStr1[0], randStr1[1], randStr1[2]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}//case
case 8:
{

if(PlayerMoney[playerid] < 500)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -500);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
SBarrel[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SBarrel", SBarrel[playerid], "accounts");
format(str, sizeof(str), "You have purchased a Small Barrel, you now have a total of %d.", SBarrel[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}
case 9:
{

if(PlayerMoney[playerid] < 750)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -750);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
MBarrel[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MBarrel", MBarrel[playerid], "accounts");
format(str, sizeof(str), "You have purchased a Medium Barrel, you now have a total of %d.", MBarrel[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}
case 10:
{

if(PlayerMoney[playerid] < 1000)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -1000);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
LBarrel[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LBarrel", LBarrel[playerid], "accounts");
format(str, sizeof(str), "You have purchased a Large Barrel, you now have a total of %d.", LBarrel[playerid]);
SendClientMessage(playerid, COLOUR_WHITE, str);

}
case 11://Random Package.
{
if(PlayerMoney[playerid] < 2000)return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much money.");
GivePlayerMoney(playerid, -2000);
//PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
new rand2[3];
new randStr2[3][25];


for(new i = 0; i < sizeof rand2; i++)
{
rand2[i] = random(3);
switch(rand2[i])
{
case 0:
{
format(randStr2[i], 25, "Small Barrel");
SBarrel[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "SBarrel", SBarrel[playerid], "accounts");

}
case 1:
{
format(randStr2[i], 25, "Medium Barrel");
MBarrel[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "MBarrel", MBarrel[playerid], "accounts");
}
case 2:
{
format(randStr2[i], 25, "Large Barrel");
LBarrel[playerid] ++;
MySQL_SetInteger(PlayerSQLID[playerid], "LBarrel", LBarrel[playerid], "accounts");
}//case 2
}//switch

}//for
format(str, sizeof(str),"You got a {33AA33}%s{FFFFFF}, a {33AA33}%s {FFFFFF}and a {33AA33}%s {FFFFFF}from the package.", randStr2[0], randStr2[1], randStr2[2]);
SendClientMessage(playerid, COLOUR_WHITE, str);
}//case
}//switch
}//dialog


ORDERGUN

CMD:ordergun(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid,5.0, -1478.3879,2630.9858,58.7879))
{

if(PlayerLevel[playerid] >= 1)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol(SG,SF,MB)", "Select", "Cancel");
}
if(PlayerLevel[playerid] >= 2)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol (SG,SF,MB)\nMP5 (MG,MF,MB)", "Select", "Cancel");
}
if(PlayerLevel[playerid] >= 3)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol (SG,SF,MB)\nMP5 (MG,MF,MB)\nDesert Eagle (MG,SF,MB)", "Select", "Cancel");
}
if(PlayerLevel[playerid] >= 4)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol (SG,SF,MB)\nMP5 (MG,MF,MB)\nDesert Eagle (MG,SF,MB)\nSawn-Off Shotgun (SG,MF,SB)", "Select", "Cancel");
}
if(PlayerLevel[playerid] >= 5)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol (SG,SF,MB)\nMP5 (MG,MF,MB)\nDesert Eagle (MG,SF,MB)\nSawn-Off Shotgun (SG,MF,SB)\nUZI (MG,MF,SB)", "Select", "Cancel");
}
if(PlayerLevel[playerid] >= 6)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol (SG,SF,MB)\nMP5 (MG,MF,MB)\nDesert Eagle (MG,SF,MB)\nSawn-Off Shotgun (SG,MF,SB)\nUZI (MG,MF,SB)\nCountry Rifle (LG,LF,LB)", "Select", "Cancel");
}
if(PlayerLevel[playerid] >= 7)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol (SG,SF,MB)\nMP5 (MG,MF,MB)\nDesert Eagle (MG,SF,MB)\nSawn-Off Shotgun (SG,MF,SB)\nUZI (MG,MF,SB)\nCountry Rifle (LG,LF,LB)\nTech-9 (SG,MF,SB)", "Select", "Cancel");
}
if(PlayerLevel[playerid] >= 8)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol (SG,SF,MB)\nMP5 (MG,MF,MB)\nDesert Eagle (MG,SF,MB)\nSawn-Off Shotgun (SG,MF,SB)\nUZI (MG,MF,SB)\nCountry Rifle (LG,LF,LB)\nTech-9 (SG,MF,SB)\nAK-47 (LG,LF,LB)", "Select", "Cancel");
}
if(PlayerLevel[playerid] >= 9)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol (SG,SF,MB)\nMP5 (MG,MF,MB)\nDesert Eagle (MG,SF,MB)\nSawn-Off Shotgun (SG,MF,SB)\nUZI(MG,MF,SB)\nCountry Rifle (LG,LF,LB)\nTech-9 (SG,MF,SB)\nAK-47 (LG,LF,LB)\nM4 Carbine (LG,LF,LB)\nCombat Shotgun (MG,LF,LB)", "Select", "Cancel");
}
if(PlayerLevel[playerid] >= 10)
{
ShowPlayerDialog(playerid, DIALOG_ORDERWEAPON, DIALOG_STYLE_LIST, "Order Weapons (Illegal)", "Order Information\n9mm Pistol (SG,SF,SB)\nStandard Shotgun (MG,MF,LB)\nSilenced 9mm Pistol (SG,SF,MB)\nMP5 (MG,MF,MB)\nDesert Eagle (MG,SF,MB)\nSawn-Off Shotgun (SG,MF,SB)\nUZI(MG,MF,SB)\nCountry Rifle (LG,LF,LB)\nTech-9 (SG,MF,SB)\nAK-47 (LG,LF,LB)\nM4 Carbine (LG,LF,LB)\nSniper Rifle (LG,LF,LB)", "Select", "Cancel");
}
}

return 1;
}

DIALOG

else if(dialogid == DIALOG_ORDERWEAPON)
{
if(response == 0)
{
return 1;
}
switch(listitem)
{
case 0:
{
new string[512];
format(string, sizeof(string), "To create a weapon you must have the correct parts + $500 ordering fee, your order will be processed within 10 hours ((10 Minutes)).\nKEY:\n{FF0000}GRIPS: {33AA33}SG = Small Grip, MG = Medium Grip, LG = Large Grip.\n{FF0000}FRAMES:{33AA33} SF = Small Frame, MF = Medium Frame, LF = Large Frame.\n{FF0000}BARRELS:{33AA33} SB = Small Barrel, MB = Medium Barrel, LB = Large Barrel.");

ShowPlayerDialog(playerid,DIALOG_ORDERINFO,DIALOG_ STYLE_MSGBOX,"Gun Order Information", string,"Close","");
}
case 1:
{
//9mm Pistol SG, SF, SB.
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(SGrip[playerid] < 1 || SFrame[playerid] < 1 || SBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Small Grip, a Small Frame and a Small Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
SGrip[playerid] --;
SFrame[playerid] --;
SBarrel[playerid] --;

WepID[playerid] = 22;
WepTime[playerid] = 10;
WeaponOrder(playerid);



}
case 2:
{
//Standard Shotgun (MG,MF,LB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(MGrip[playerid] < 1 || MFrame[playerid] < 1 || LBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Medium Grip, a Medium Frame and a Large Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
MGrip[playerid] --;
MFrame[playerid] --;
LBarrel[playerid] --;

WepID[playerid] = 25;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 3:
{
//Silenced 9mm Pistol (SG,SF,MB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(SGrip[playerid] < 1 || SFrame[playerid] < 1 || MBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Small Grip, a Small Frame and a Medium Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
SGrip[playerid] --;
SFrame[playerid] --;
MBarrel[playerid] --;

WepID[playerid] = 23;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 4:
{
//MP5 (MG,MF,MB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(MGrip[playerid] < 1 || MFrame[playerid] < 1 || MBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Medium Grip, a Medium Frame and a Medium Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
MGrip[playerid] --;
MFrame[playerid] --;
MBarrel[playerid] --;

WepID[playerid] = 29;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 5:
{
//Desert Eagle (MG,SF,MB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(MGrip[playerid] < 1 || SFrame[playerid] < 1 || MBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Medium Grip, a Small Frame and a Medium Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
MGrip[playerid] --;
SFrame[playerid] --;
MBarrel[playerid] --;

WepID[playerid] = 24;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 6:
{
//Sawn-Off Shotgun (SG,MF,SB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(SGrip[playerid] < 1 || MFrame[playerid] < 1 || SBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Small Grip, a Medium Frame and a Small Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
SGrip[playerid] --;
MFrame[playerid] --;
SBarrel[playerid] --;

WepID[playerid] = 26;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 7:
{
//UZI(MG,MF,SB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(MGrip[playerid] < 1 || MFrame[playerid] < 1 || SBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Medium Grip, a Medium Frame and a Small Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
MGrip[playerid] --;
MFrame[playerid] --;
SBarrel[playerid] --;

WepID[playerid] = 28;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 8:
{
//Country Rifle (LG,LF,LB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(LGrip[playerid] < 1 || LFrame[playerid] < 1 || LBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Large Grip, a Large Frame and a Large Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
LGrip[playerid] --;
LFrame[playerid] --;
LBarrel[playerid] --;

WepID[playerid] = 33;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 9:
{
//Tech-9 (SG,MF,SB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(SGrip[playerid] < 1 || MFrame[playerid] < 1 || SBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Small Grip, a Medium Frame and a Small Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
SGrip[playerid] --;
MFrame[playerid] --;
SBarrel[playerid] --;

WepID[playerid] = 32;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 10:
{
//AK-47 (LG,LF,LB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(LGrip[playerid] < 1 || LFrame[playerid] < 1 || LBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Large Grip, a Large Frame and a Large Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
LGrip[playerid] --;
LFrame[playerid] --;
LBarrel[playerid] --;

WepID[playerid] = 30;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 11:
{
//M4 Carbine (LG,LF,LB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(LGrip[playerid] < 1 || LFrame[playerid] < 1 || LBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Large Grip, a Large Frame and a Large Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
LGrip[playerid] --;
LFrame[playerid] --;
LBarrel[playerid] --;

WepID[playerid] = 31;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
case 12:
{
//Sniper Rifle (LG,LF,LB)
PlayerMoney[playerid] = GetPlayerMoney(playerid);
if(WepID[playerid] > 0)return SendClientMessage(playerid, COLOUR_GREY, "You already have a weapon ordered, you must wait until this is complete.");
if(PlayerMoney[playerid] < 500) return SendClientMessage(playerid, COLOUR_GREY,"Ordering costs $500");
if(LGrip[playerid] < 1 || LFrame[playerid] < 1 || LBarrel[playerid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You must have a Large Grip, a Large Frame and a Large Barrel to create this weapon.");

GivePlayerMoney(playerid, - 500);
LGrip[playerid] --;
LFrame[playerid] --;
LBarrel[playerid] --;

WepID[playerid] = 34;
WepTime[playerid] = 10;
WeaponOrder(playerid);

}
}
}


Could it be general server lag? I don't have lots of timers etc, if it is, how could I address this issue or check and see if it is server lag?

Jankingston
05/12/2013, 03:33 PM
United Role Play\Ross County Role Play\zGaming Role Play\Union gaming roleplay and much other GM's got bigger dialogs than this, it dosent cause the server lag..

Your server lag could be due to your server host, maybe it is proving less memory or less ram.
2nd, check your internet connection is fast :D

Thankk You.

Dokins
05/12/2013, 03:44 PM
So there is no other reason for this except that?
Is there anyway to check if it is indeed the host or?

Jankingston
05/12/2013, 03:50 PM
So there is no other reason for this except that?
Is there anyway to check if it is indeed the host or?

which host you are using ? if you are using sa-mp.gs > then simply click on "delete" button...It stinks !!! :picard:

Emmet_
05/12/2013, 03:55 PM
Lag would generally be a problem with the PC specifications and memory usage.

If the server is crashing, it's probably due to a stack or heap collision, which happens when there is too much allocated memory on the stack, corrupting and overwriting general data.

If you have any warnings, then I suggest you add this code above your script:


#pragma dynamic 65536


I would suggest that you crack down on the cell usage aswell.

Dokins
05/12/2013, 03:58 PM
I'm using KingJ server, 4 slots.

It does seem to just be memory lag, because its fast sometimes, others not.

I don't have any warnings, However, I appreciate the nice advice instead of people going crazy aha!

I will heed your advice.

Jankingston
05/12/2013, 04:00 PM
Can you show us your PC Specification?

OT: KingJ is nice :D lag wont be there :P sorry :P

Dokins
05/12/2013, 04:05 PM
ACER
ASPIRE
Intel(R)Core(TM) 2 DUO CPU T6400 @ 2.00GHZ 2.00GHz

RAM :3.00GB
I play other servers and have no issue.

Dokins
06/12/2013, 12:10 AM
Still unresolved

DavidLuango
06/12/2013, 12:36 AM
Have you tried using Enumrators to define? That might decrease your lag.

cessil
06/12/2013, 03:52 AM
use the profiler plugin, I don't believe its the dialogs causing these problems

Dokins
07/12/2013, 01:45 AM
Thank you. I'm going to check it out.