PDA

Просмотр полной версии : [Вопрос] MafiaZone



gangzone.ini
26.08.2014, 14:51
Почему не грузят зоны мафии ?

enum MzoneInfo
{
gID,
Float:gCoords[4],
gMemberZone
}
new MZInfo[16][MzoneInfo];

new TotalMafZones;
В public OnGameModeInit()

LoadMaf();
В public OnPlayerConnect(playerid)

for(new i = 1; i < 15;i++)
{
GangZoneShowForPlayer(playerid, MZInfo[i][gID], GetMafZoneColor(i));
}
В конце мода:

stock GetMafZoneColor(mafiazonex)
{
new zx;
switch(MZInfo[mafiazonex][gMemberZone])
{
case 0: zx = 0xFFFFFFAA;
case 1: zx = CLCN;
case 2: zx = CYAKUZA;
case 3: zx = CRM;
}
return zx;
}

stock SaveMaf(i)
{
new savezonesass[200];
format(savezonesass, sizeof(savezonesass),
"update affect set x = '%f',y = '%f',xx = '%f',yy = '%f',member = '%i' where ID = '%i'",
MZInfo[i][gCoords][0],MZInfo[i][gCoords][1],MZInfo[i][gCoords][2],MZInfo[i][gCoords][3],MZInfo[i][gMemberZone],i);
mysql_pquery(dbHandle,savezonesass);
return true;
}

forward LoadMaf();
public LoadMaf()
{
TotalMafZones = cache_num_rows();
if(TotalMafZones)
{
for(new indexsa = 1; indexsa <= TotalMafZones; indexsa++)
{
MZInfo[indexsa][gCoords][0] = cache_get_field_content_float(indexsa-1, "X");
MZInfo[indexsa][gCoords][1] = cache_get_field_content_float(indexsa-1, "Y");
MZInfo[indexsa][gCoords][2] = cache_get_field_content_float(indexsa-1, "XX");
MZInfo[indexsa][gCoords][3] = cache_get_field_content_float(indexsa-1, "YY");
MZInfo[indexsa][gMemberZone] = cache_get_field_content_int(indexsa-1, "Member");
MZInfo[indexsa][gID] = GangZoneCreate(MZInfo[indexsa][gCoords][0], MZInfo[indexsa][gCoords][1], MZInfo[indexsa][gCoords][2], MZInfo[indexsa][gCoords][3]);
GangZoneShowForAll(MZInfo[indexsa][gID], GetMafZoneColor(indexsa));
}
printf("Òåððèòîðèé ìàôèè çàãðóæåíû %i. [Äëèòåëüíîñòü çàãðóçêè: %d ms]", TotalMafZones, cache_get_query_exec_time(UNIT_MILLISECONDS));
}
return true;
}

stock LoadMafia()
{
mysql_pquery(dbHandle, "SELECT * FROM `affect`", "LoadMaf") ;
return true;
}