15.08.2016, 12:59
Quote:
cache_get_data is of little use if you don't check its output, i.e. whether there are actually any rows in the result.
|
Код:
case THREAD_LOAD_CHARACTER: { if (cache_get_row_count(g_iHandle) == 0) { // No rows found return 1; } pInfo[extraid][pID] = cache_get_field_int(0, "ID"); pInfo[extraid][Registered] = cache_get_field_int(0, "Enregistrer"); pInfo[extraid][Admin] = cache_get_field_int(0, "Admin"); pInfo[extraid][Level] = cache_get_field_int(0, "Level"); pInfo[extraid][Exp] = cache_get_field_int(0, "Exp"); pInfo[extraid][MaxExp] = cache_get_field_int(0, "MaxExp"); pInfo[extraid][Skin] = cache_get_field_int(0, "Skin"); pInfo[extraid][Gender] = cache_get_field_int(0, "Sexe"); pInfo[extraid][Health] = cache_get_field_float(0, "Vie"); pInfo[extraid][Armour] = cache_get_field_float(0, "Gillet"); pInfo[extraid][HandMoney] = cache_get_field_int(0, "Cash"); pInfo[extraid][BankMoney] = cache_get_field_int(0, "BanqueCash"); pInfo[extraid][Mask] = cache_get_field_int(0, "Masque"); pInfo[extraid][MaskID] = cache_get_field_int(0, "MasqueID"); pInfo[extraid][PhoneNumber] = cache_get_field_int(0, "NumeroTel"); pInfo[extraid][HouseOwner] = cache_get_field_int(0, "Maison"); pInfo[extraid][BizOwner] = cache_get_field_int(0, "Commerce"); pInfo[extraid][FacOwner] = cache_get_field_int(0, "FactionProprio"); pInfo[extraid][VehicleOwner] = cache_get_field_int(0, "Vehicule1"); pInfo[extraid][VehicleOwner2] = cache_get_field_int(0, "Vehicule2"); pInfo[extraid][VehicleOwner3] = cache_get_field_int(0, "Vehicule3"); pInfo[extraid][SecteID] = cache_get_field_int(0, "Faction"); pInfo[extraid][Grade] = cache_get_field_int(0, "Grade"); pInfo[extraid][PayeCheck] = cache_get_field_int(0, "ChequeJob"); pInfo[extraid][PayeTime] = cache_get_field_int(0, "TempsTravail"); pInfo[extraid][Montre] = cache_get_field_int(0, "Montre"); pInfo[extraid][Gps] = cache_get_field_int(0, "GPS"); pInfo[extraid][Canne] = cache_get_field_int(0, "Canne"); pInfo[extraid][Phone] = cache_get_field_int(0, "Telephone"); pInfo[extraid][Credits] = cache_get_field_int(0, "Credits"); pInfo[extraid][CarteIden] = cache_get_field_int(0, "Identite"); pInfo[extraid][DrogueFab1] = cache_get_field_int(0, "GramDrogue1"); pInfo[extraid][DrogueFab2] = cache_get_field_int(0, "GramDrogue2"); pInfo[extraid][DrogueFab3] = cache_get_field_int(0, "GramDrogue3"); pInfo[extraid][Cocaine] = cache_get_field_int(0, "Cocaine"); pInfo[extraid][Heroine] = cache_get_field_int(0, "Heroine"); pInfo[extraid][Ecstacy] = cache_get_field_int(0, "Ecstacy"); pInfo[extraid][Mort] = cache_get_field_int(0, "Mort"); pInfo[extraid][JailTime] = cache_get_field_int(0, "JailTemps"); pInfo[extraid][Amende] = cache_get_field_int(0, "Amende"); pInfo[extraid][Facture] = cache_get_field_int(0, "Facture"); pInfo[extraid][Emprunt] = cache_get_field_int(0, "Emprunt"); pInfo[extraid][Lotto] = cache_get_field_int(0, "Warn"); pInfo[extraid][Baned] = cache_get_field_int(0, "Bannis"); pInfo[extraid][Permis] = cache_get_field_int(0, "Permis"); pInfo[extraid][PermisPoint] = cache_get_field_int(0, "PointPermis"); pInfo[extraid][PortArme] = cache_get_field_int(0, "PortArme"); pInfo[extraid][LastPos] = cache_get_field_int(0, "Situation"); pInfo[extraid][Weapon1] = cache_get_field_int(0, "Arme1"); pInfo[extraid][Wep1Ammo] = cache_get_field_int(0, "Wep1Ammo"); pInfo[extraid][Weapon2] = cache_get_field_int(0, "Arme2"); pInfo[extraid][Wep2Ammo] = cache_get_field_int(0, "Wep2Ammo"); pInfo[extraid][Weapon3] = cache_get_field_int(0, "Arme3"); pInfo[extraid][Wep3Ammo] = cache_get_field_int(0, "Wep3Ammo"); pInfo[extraid][Weapon4] = cache_get_field_int(0, "Arme4"); pInfo[extraid][Wep4Ammo] = cache_get_field_int(0, "Wep4Ammo"); pInfo[extraid][Weapon5] = cache_get_field_int(0, "Arme5"); pInfo[extraid][Wep5Ammo] = cache_get_field_int(0, "Wep5Ammo"); pInfo[extraid][Weapon6] = cache_get_field_int(0, "Arme6"); pInfo[extraid][Wep6Ammo] = cache_get_field_int(0, "Wep6Ammo"); pInfo[extraid][Weapon7] = cache_get_field_int(0, "Arme7"); pInfo[extraid][Wep7Ammo] = cache_get_field_int(0, "Wep7Ammo"); if (pInfo[extraid][Admin] > 0) { SendClientMessage(extraid, -1, "Vous кtes connectй en tant qu'admuinistrateur."); //SendAdminAction(extraid, "You have logged in a level %d admin.", pInfo[extraid][pAdmin]); } pInfo[extraid][pLogged] = 1; SendClientMessage(extraid, -1, "Connexion rйussi veuillez informer le fondateur"); SetTimerEx("SpawnTimer", 1000, false, "d", extraid); }