02.08.2014, 21:48
Tien un exemple que je me sert perso:
PHP код:
forward AtmLoad();
public AtmLoad()
{
AtmCount = cache_get_row_count();
for(new i = 0; i < AtmCount+1; i++)
{
AtmInfo[i][aID] = cache_get_field_content_int(i-1, "Atm_ID");
AtmInfo[i][aPos][0] = cache_get_field_content_int(i-1, "Atm_PosX");
AtmInfo[i][aPos][1] = cache_get_field_content_int(i-1, "Atm_PosY");
AtmInfo[i][aPos][2] = cache_get_field_content_int(i-1, "Atm_PosZ");
AtmInfo[i][aPos][3] = cache_get_field_content_int(i-1, "Atm_PosA");
AtmInfo[i][aCash] = cache_get_field_content_int(i-1, "Atm_Cash");
AtmInfo[i][aEtat] = cache_get_field_content_int(i-1, "Atm_Etat");
if(AtmInfo[i][aEtat] == 0)
{
AtmInfo[i][aObject] = CreateObject(2943, AtmInfo[i][aPos][0],AtmInfo[i][aPos][1],AtmInfo[i][aPos][2],AtmInfo[i][aPos][3],0,0);
}
if(AtmInfo[i][aEtat] == 1)
{
AtmInfo[i][aObject] = CreateObject(2754, AtmInfo[i][aPos][0],AtmInfo[i][aPos][1],AtmInfo[i][aPos][2],AtmInfo[i][aPos][3],0,0);
}
}
printf("[MYSQL]: %d atm on йtй chargй",AtmCount);
return 1;
}