03.03.2014, 15:05
Quite often I'm hired to "fix lag", or some "minor" stuff. I'm not perfect too, but well, the things I've seen... Well, it might seem minor for players, but when you have to dissect the code, you can see the beast inside.
Number 1: Whole Raven's RP
Arrays? What's that?
Oh, I remember now!
Between poor design decisions and stuff, that's a little sad that it's one of the most popular GM's. But I'm not a player, so maybe features outweight other things. Maybe.
2. Some other things
I wondered why sqlitei autofree storage was overflowing. Well, when someone is firing >2k queries, it might choke everything a little.
Share your traumatic experiences.
#e: Ha, the #2 isn't as bad as I thought, it "only" tries for 50 times.
Number 1: Whole Raven's RP
pawn Код:
enum pInfo
{
//(...)
pAchievement0,
pAchievement1,
pAchievement2,
pAchievement3,
pAchievement4,
pAchievement5,
pAchievement6,
pAchievement7,
pAchievement8,
pAchievement9,
pAchievement10,
pAchievement11,
pAchievement12,
pAchievement13,
pAchievement14,
pAchievement15,
pAchievement16,
pAchievement17,
pAchievement18,
pAchievement19,
pAchievement20,
pShiftName,
pWeapon,
pWeapon2,
pWeapon3,
pWeapon4,
pWeapon5,
pWeapon6,
pWeapon7,
pWeapon8,
pWeapon9,
pWeapon10,
pWeapon11,
pWeapon12,
pAmmo,
pAmmo2,
pAmmo3,
pAmmo4,
pAmmo5,
pAmmo6,
pAmmo7,
pAmmo8,
pAmmo9,
pAmmo10,
pAmmo11,
pAmmo12,
//(...)
}
pawn Код:
new RandomFemaleSkins[][] =
{
{9},{10},{11},{38},{39},{40},{54},{55},{56},{63},{64},{75},{76},{77},
{85},{87},{88},{90},{93},{131},{130},{138},{139},{141},{145},{148},{149},
{152},{157},{169},{172},{178},{190},{192},{193},{194},{199},{198},{201},
{207},{211},{215},{219},{225},{226},{233},{237},{244},{246},{251},{257},
{263}
};
Between poor design decisions and stuff, that's a little sad that it's one of the most popular GM's. But I'm not a player, so maybe features outweight other things. Maybe.
2. Some other things
pawn Код:
new DBResult:result = db_query(ServerDB, "SELECT * FROM `PermCars`");
id = db_num_rows(result) + 1;
format(string, sizeof(string), "SELECT * FROM `PermCars` WHERE `PermCarID` = '%d'", id);
dbResult[0] = db_query(ServerDB, string);
if (db_num_rows(dbResult[0]) != 0)
{
// That ID exists... let's keep finding one that doesn't exist then.
while (!found && attempts++ != 50)
{
id++;
format(string, sizeof(string), "SELECT * FROM `PermCars` WHERE `PermCarID` = '%d'", id);
dbResult[1] = db_query(ServerDB, string);
if (db_num_rows(dbResult[1]) != 0)
{
db_free_result(dbResult[1]);
continue;
}
else
{
db_free_result(dbResult[1]);
found = true;
break;
}
}
}
else found = true;
db_free_result(result);
Share your traumatic experiences.
#e: Ha, the #2 isn't as bad as I thought, it "only" tries for 50 times.