forward OnBansLoad();
public OnBansLoad()
{
new
rows,
fields
;
cache_get_data( rows, fields, Handle);
if(!rows)
{
print("Bans table is empty, no results found.");
return 1;
}
new
i = 0
;
while(rows > i)
{
APlayerData[i][BanVariable] = true;// You had only this, no loading any other
printf("Ban %d Loaded", i);
i++;
}
return 1;
}
while(rows > i)
{
APlayerData[i][BanVariable] = true;// You had only this, no loading any other
printf("Ban %d Loaded", i);
i++;
}
//while(i < rows) would make more sense though, at least for me. It would be easier to understand.
enum pEnum
{
Name[MAX_PLAYER_NAME],
Text3D:NameTag[31],
Password[31],
Admin,
Money,
Score,
Points,
PlayerLogged,
CourierHouses[11],
CourierMaxStep,
Float:X,
Float:Y,
Float:Z,
Float:Rot,
bool:AText,
bool:PlayerVariable[MAX_PLAYERS],
bool:BanVariable,
ECoins,
Muted,
LastPmID,
pAccent[128],
TruckerLicense,
Windows,
SpectateID,
SpectateType,
EngineStarted,
Text:Location,
CurrentHouse,
Houses[MAX_HOUSESPERPLAYER],
SpectateVehicle,
gEngine,
MLevel,
DonatorLevel,
PlayerClass,
JobStep,
bool:AFK,
bool:JobStarted,
JobLoc1,
JobLoc2,
LoadID,
VehicleID,
TrailerID,
VehicleTimerTime,
JobID,
VehicleTimer,
LoadingTimer,
StatsTruckerJobs,
StatsPilotJobs,
StatsPlayersFined,
StatsConvoyJobs,
Fines[MAX_PLAYERS],
PlayerSpeed,
PlayerCaughtSpeeding,
PlayerCheckTimer,
PlayerJailed,
PlayerJailedTimer,
bool:PoliceWarnedMe,
Value_PoliceCanJailMe,
Timer_PoliceCanJailMe,
bool:PoliceCanJailMe,
Warnings,
DialogGetCarHouseID,
bool:InConvoy,
ConvoyID,
StatsCourierJobs
}
APlayerData[i][BanVariable] = true;//why Do you need in loading rows? because this is a per-player enum,
When you delete a row in mysql it sets it as false. So the ID slot can be used again. Also the BanVariable doesnt have [MAX_PLAYERS] behind it?
|