FORUM OBAVIJEST: Nagrade za nove i stare korisnike
SA:MP zajednica Zapadni Balkan

Ned - 22.09.2019. - 10:52
Aktiviraj Nyx stil Aktiviraj Elastica stil
181
posjeta

Tema: [Pomoc]Neocitabva iz baze kako valja

0 Članova i 1 Gost pregledava ovu temu.
 Str: [1]   Dolje   « natrag naprijed »
*
Trening kamp: 20/20

Problem: Tekst
Detaljan opis problema: Nece da ocita iz baze memberSlD i membType i samim time ingem player nije u organizaciji
Deo skripte: FUNCTION: OnOrgMembersLoad( )
{
new rows, OrgID = -1, Counter[ MAX_ORG ], sqlID = 0;
    cache_get_row_count(rows);
   
if( rows )
{
for( new i = 0; i < rows; i ++ )
{
    sqlID = cache_get_value_name_int( i, "org_id", org_info[ i ][ oID ] );
    OrgID = -1;
   
    for( new id = 1; id < MAX_ORG; id++)
{
        if( org_info[ id ][ oID ] == sqlID )
{
            OrgID = id;
            break;
        }
    }

            if( OrgID != -1 )
{
        cache_get_value_name_int( i, "memb_type", org_members_info[ i ][ Counter[ i ] ][ o_m_type ] );
        cache_get_value_name_int( i, "memb_sqlID", org_members_info[ i ][ Counter[ i ] ][ o_m_sqlID ] );
    cache_get_value_name( i, "p_name", org_members_info[ OrgID ][ Counter[ OrgID ] ][ o_m_Name ], MAX_PLAYER_NAME );

    if( org_members_info[ OrgID ][ Counter[ OrgID ] ][ o_m_type ] == 0 ) org_info[ OrgID ][ oUbacenihClanova ]++;
    Counter[ OrgID ]++;
}
}
}
}

Slika Problema (nije obavezno ukoliko je u pitanju error/warning): https://imgur.com/a/p0b0GM9

Offline
Prijatelj zajednice
 | 718
*******
Spol: Muški
Scripter
Trening kamp: 20/20

Koliko mi se čini da ti ovde učitavaš membere za organizacije, a ne igračeve podatke..
Pošalji deo koda gde učitavaš igračeve podatke iz tablice tipa users, igraci...

*
Trening kamp: 20/20

FUNCTION: OnAccountLoad( playerid )
{
static rows;
cache_get_row_count(rows);
if( rows )
{
    LoginTDControl(playerid, false);
   
cache_get_value_name_int(0, "user_id", PlayerInfo[ playerid ][ xID ] );
cache_get_value_name_int(0, "sex", PlayerInfo[ playerid ][ xPol ] );
cache_get_value_name_int(0, "age", PlayerInfo[ playerid ][ xGodine ] );
cache_get_value_name_int(0, "money", PlayerInfo[ playerid ][ xNovac ] );
cache_get_value_name_int(0, "level", PlayerInfo[ playerid ][ xLevel ] );
cache_get_value_name_int(0, "exp", PlayerInfo[ playerid ][ xRespekt ] );
cache_get_value_name_int(0, "upgrades", PlayerInfo[ playerid ][ xPoboljsanja ] );
cache_get_value_name_int(0, "payday", PlayerInfo[ playerid ][ xPayDay ] );
cache_get_value_name_int(0, "cstdm_score", PlayerInfo[ playerid ][ xCSTDMScore ] );
cache_get_value_name_int(0, "admin_lvl", PlayerInfo[ playerid ][ xAdmin ] );
cache_get_value_name_int(0, "skin_id", PlayerInfo[ playerid ][ xSkin ] );
cache_get_value_name_int(0, "spawn", PlayerInfo[ playerid ][ xSpawn ] );

cache_get_value_name_int(0, "materials", PlayerInfo[ playerid ][ xMaterijali ] );
cache_get_value_name_int(0, "bussines_id", PlayerInfo[ playerid ][ xBussinesSqlID ] );
cache_get_value_name_int(0, "job_id", PlayerInfo[ playerid ][ xPosao ] );
cache_get_value_name_int(0, "contract", PlayerInfo[ playerid ][ xUgovor ] );
cache_get_value_name_int(0, "mech_skill", PlayerInfo[ playerid ][ xMehSkill ] );
cache_get_value_name_int(0, "mech_parts", PlayerInfo[ playerid ][ xMDelovi ] );

cache_get_value_name_int(0, "fight_style", PlayerInfo[ playerid ][ xBStil ] );
cache_get_value_name_float(0, "spawn_hp", PlayerInfo[ playerid ][ xSHealth ] );
cache_get_value_name_int(0, "phone_number", PlayerInfo[ playerid ][ xBrojTelefona ] );
cache_get_value_name_int(0, "vehicle_license", PlayerInfo[ playerid ][ xVozacka ] );
cache_get_value_name_int(0, "bike_license", PlayerInfo[ playerid ][ xMotorska ] );
cache_get_value_name_int(0, "c1_license", PlayerInfo[ playerid ][ xKamionskaC1 ] );
cache_get_value_name_int(0, "c2_license", PlayerInfo[ playerid ][ xKamionskaC2 ] );
cache_get_value_name_int(0, "c3_license", PlayerInfo[ playerid ][ xKamionskaC3 ] );
cache_get_value_name_int(0, "boat_license", PlayerInfo[ playerid ][ xBrodska ] );
cache_get_value_name_int(0, "air_license", PlayerInfo[ playerid ][ xLetelica ] );

cache_get_value_name_int(0, "injection", PlayerInfo[ playerid ][ xInekcija ] );
cache_get_value_name_int(0, "toolkit", PlayerInfo[ playerid ][ xToolkit ] );

cache_get_value_name_int(0, "property_id_1", PlayerInfo[ playerid ][ xProperty ][ 0 ] );
cache_get_value_name_int(0, "property_id_2", PlayerInfo[ playerid ][ xProperty ][ 1 ] );
cache_get_value_name_int(0, "property_id_3", PlayerInfo[ playerid ][ xProperty ][ 2 ] );

cache_get_value_name_int(0, "gun_license", PlayerInfo[ playerid ][ xGunLicense ] );
cache_get_value_name_int(0, "phone_model", PlayerInfo[ playerid ][ xModelTelefona ] );
cache_get_value_name_int(0, "phone_credit", PlayerInfo[ playerid ][ xTelefonBon ] );
cache_get_value_name_int(0, "strenght", PlayerInfo[ playerid ][ xSnaga ] );
cache_get_value_name_int(0, "jail_type", PlayerInfo[ playerid ][ xZatvor ] );
cache_get_value_name_int(0, "jail_time", PlayerInfo[ playerid ][ xZatvorVreme ] );
cache_get_value_name_int(0, "wanted_level", PlayerInfo[ playerid ][ xWanted ] );
cache_get_value_name_int(0, "arrested", PlayerInfo[ playerid ][ xUhapsen ] );
cache_get_value_name_int(0, "tutorial", PlayerInfo[ playerid ][ xPocetniTut ] );
cache_get_value_name_int(0, "admin_code", PlayerInfo[ playerid ][ xAKod ] );
cache_get_value_name_int(0, "watch", PlayerInfo[ playerid ][ xSat ] );
cache_get_value_name_int(0, "mask_id", PlayerInfo[ playerid ][ xMaskID ] );
cache_get_value_name_int(0, "bank_money", PlayerInfo[ playerid ][ xBRacun ] );
cache_get_value_name_int(0, "credit_rest", PlayerInfo[ playerid ][ xPreostaloZaOtplatu ] );
cache_get_value_name_int(0, "credit_amount", PlayerInfo[ playerid ][ xIznosKredita ] );
cache_get_value_name_int(0, "credit_installment", PlayerInfo[ playerid ][ xIznosRate ] );
cache_get_value_name_int(0, "hours_online", PlayerInfo[ playerid ][ xOnlineSati ] );
cache_get_value_name_int(0, "helper_level", PlayerInfo[ playerid ][ xHelper ] );
cache_get_value_name_int(0, "rp_learn", PlayerInfo[ playerid ][ xRPLearn ] );
cache_get_value_name_int(0, "warn", PlayerInfo[ playerid ][ xWarn ] );
cache_get_value_name_int(0, "mute", PlayerInfo[ playerid ][ xMute ] );

cache_get_value_name_float(0, "marker_p1", PlayerInfo[ playerid ][ xMarker ][ 0 ] );
cache_get_value_name_float(0, "marker_p2", PlayerInfo[ playerid ][ xMarker ][ 1 ] );
cache_get_value_name_float(0, "marker_p3", PlayerInfo[ playerid ][ xMarker ][ 2 ] );

cache_get_value_name_int(0, "cnn_news", PlayerInfo[ playerid ][ xBrojNews ] );
cache_get_value_name_int(0, "org_contract", PlayerInfo[ playerid ][ xOrgUgovor ] );
cache_get_value_name_int(0, "gps_level", PlayerInfo[ playerid ][ xGpsLevel ] );

cache_get_value_name_int(0, "mayor", PlayerInfo[ playerid ][ xGradRank ] );
cache_get_value_name_int(0, "spec_rank", PlayerInfo[ playerid ][ xSkriptaRank ] );
cache_get_value_name_int(0, "country", PlayerInfo[ playerid ][ xDrzava ] );
cache_get_value_name(0, "email", PlayerInfo[ playerid ][ xEmail ], 128 );
cache_get_value_name_int(0, "vip_level", PlayerInfo[ playerid ][ xVIPLevel ] );
cache_get_value_name_int(0, "hitman_price", PlayerInfo[ playerid ][ xHitmenCena ] );
cache_get_value_name_int(0, "org_punishment", PlayerInfo[ playerid ][ xKazneniUgovor ] );
cache_get_value_name(0, "offpjail", PlayerInfo[ playerid ][ xOffPJail ], 64 );
cache_get_value_name(0, "offpprison", PlayerInfo[ playerid ][ xOffPPrison ], 64 );
cache_get_value_name(0, "offpmute", PlayerInfo[ playerid ][ xOffPMute ], 64 );
cache_get_value_name_int(0, "staff_min", PlayerInfo[ playerid ][ xStaffMin ] );
cache_get_value_name(0, "last_login", PlayerInfo[ playerid ][ xLastLogin ], 64 );
cache_get_value_name_int(0, "married", PlayerInfo[ playerid ][ xMarried ] );
cache_get_value_name(0, "married_to", PlayerInfo[ playerid ][ xMarriedTo ], 64 );
cache_get_value_name_int(0, "hotel_id", PlayerInfo[ playerid ][ xHotelID ] );
cache_get_value_name_int(0, "hotel_room", PlayerInfo[ playerid ][ xHotelRoom ] );

cache_get_value_name_int(0, "promoter", PlayerInfo[ playerid ][ xPromoter ] );
cache_get_value_name_int(0, "field_id", PlayerInfo[ playerid ][ xFieldID ] );
cache_get_value_name_int(0, "bunker_id", PlayerInfo[ playerid ][ xBunkerID ] );
cache_get_value_name_int(0, "plums_seed", PlayerInfo[ playerid ][ xSemeSljive ] );
cache_get_value_name_int(0, "pears_seed", PlayerInfo[ playerid ][ xSemeKruske ] );
cache_get_value_name_int(0, "apples_seed", PlayerInfo[ playerid ][ xSemeJabuke ] );
cache_get_value_name_int(0, "cabbage_seed", PlayerInfo[ playerid ][ xSemeKupusa ] );
cache_get_value_name_int(0, "roses_seed", PlayerInfo[ playerid ][ xSemeRuze ] );
cache_get_value_name_int(0, "lotto_number", PlayerInfo[ playerid ][ xLottoNumber ] );
cache_get_value_name_int(0, "lotto_money", PlayerInfo[ playerid ][ xLottoMoney ] );
cache_get_value_name_int(0, "garage_id", PlayerInfo[ playerid ][ xGarageSqlID ] );
cache_get_value_name_int(0, "bank_acc", PlayerInfo[ playerid ][ xImaBRacun ] );
cache_get_value_name_int(0, "job_bank_acc", PlayerInfo[ playerid ][ xPlatniRacun ] );
cache_get_value_name_int(0, "vehicle_slots", PlayerInfo[ playerid ][ xSlotoviVozila ] );
cache_get_value_name_int(0, "rob_time", PlayerInfo[ playerid ][ xPljackaVreme ] );
cache_get_value_name_int(0, "leave_jail", PlayerInfo[ playerid ][ xLeaveJail ] );
cache_get_value_name_int(0, "bail_price", PlayerInfo[ playerid ][ xBailPrice ] );
cache_get_value_name_int(0, "hangar_time", PlayerInfo[ playerid ][ xHangarTime ] );
cache_get_value_name_int(0, "event_first_place", PlayerInfo[ playerid ][ xEvent1Mesto ] );
cache_get_value_name_int(0, "event_second_place", PlayerInfo[ playerid ][ xEvent2Mesto ] );
cache_get_value_name_int(0, "event_third_place", PlayerInfo[ playerid ][ xEvent3Mesto ] );
cache_get_value_name_int(0, "dm_event_kills", PlayerInfo[ playerid ][ xDMEventUbistva ] );
cache_get_value_name_int(0, "rent_id", PlayerInfo[ playerid ][ xRentID ] );
cache_get_value_name_int(0, "gold", PlayerInfo[ playerid ][ xZlato ] );
cache_get_value_name_int(0, "reserve_keys", PlayerInfo[ playerid ][ xRezervniKljucevi ] );
cache_get_value_name_int(0, "dbo", PlayerInfo[ playerid ][ xDBO ] );
cache_get_value_name_int(0, "dbo_color", PlayerInfo[ playerid ][ xDBoja ] );
cache_get_value_name_int(0, "rp_poen", PlayerInfo[ playerid ][ xRPPoen ] );
cache_get_value_name_int(0, "ap_poen", PlayerInfo[ playerid ][ xApoeni ] );
cache_get_value_name_int(0, "ap_poen_2", PlayerInfo[ playerid ][ xPodApoeni ] );
cache_get_value_name_float(0, "vip_time", PlayerInfo[ playerid ][ xVipTime ] );
cache_get_value_name_int(0, "taking_time", PlayerInfo[ playerid ][ xZauzimanjeVreme ] );
cache_get_value_name_int(0, "gift", PlayerInfo[ playerid ][ xPoklon ] );
cache_get_value_name_int(0, "special_gift", PlayerInfo[ playerid ][ xPaketic ] );
cache_get_value_name(0, "gate_key", PlayerInfo[ playerid ][ xKljucKapije ], 64 );
cache_get_value_name_int(0, "mats_smugl", PlayerInfo[ playerid ][ xSvercer ] );
cache_get_value_name(0, "reg_date", PlayerInfo[ playerid ][ xRegDate ], 64 );

  new sqlID = 0, OrgID = -1;

sqlID = cache_get_value_name_int( 0, "org_id", org_info[ playerid ][ oID ] );

if( sqlID != 0  )
{
for( new id = 1; id < MAX_ORG; id++)
{
if( org_info[ id ][ oID ] == sqlID )
{
OrgID = id;
break;
}
}

    if( OrgID != -1 )
{
    cache_get_value_name_int(0, "memb_rank", PlayerInfo[ playerid ][ xRank ] );

    new o_type = cache_get_value_name_int( 0, "memb_type" );

    if( o_type == 1 ) PlayerInfo[ playerid ][ xLider ] = OrgID;

    PlayerInfo[ playerid ][ xClan ] = OrgID;
}
    }

if( PlayerInfo[ playerid ][ xBussinesSqlID ] != 0 )
{
for( new i = 1; i < MAX_BUSSINES; i++ )
{
if( PlayerInfo[ playerid ][ xBussinesSqlID ] == BussinesInfo[ i ][ b_ID ] )
{
PlayerInfo[ playerid ][ xFirmaID ] = i;
break;
}
}
}

if( PlayerInfo[ playerid ][ xGarageSqlID ] != 0 )
{
for( new i = 1; i < MAX_GARAGES; i++ )
{
if( PlayerInfo[ playerid ][ xGarageSqlID ] == garageInfo[ i ][ garageSqlID ] )
{
PlayerInfo[ playerid ][ xGarageID ] = i;
break;
}
}
}

if( PlayerInfo[ playerid ][ xFirmaID ] != -1 )
{
BussinesInfo[ PlayerInfo[ playerid ][ xFirmaID ] ][ bNeaktivnost ] = 0;
sql_bussines_update_integer( PlayerInfo[ playerid ][ xFirmaID ], "b_neaktivnost", BussinesInfo[ PlayerInfo[ playerid ][ xFirmaID ] ][ bNeaktivnost ] );
}

if( PlayerInfo[ playerid ][ xProperty ][ 0 ] != -1 )
{
II[ PlayerInfo[ playerid ][ xProperty ][ 0 ] ][ iNeaktivnost ] = 0;
//SaveProperty( PlayerInfo[ playerid ][ xProperty ][ 0 ] );
sql_update_property(PlayerInfo[playerid][xProperty][0], "iNeaktivnost", 0);
}
if( PlayerInfo[ playerid ][ xProperty ][ 1 ] != -1 )
{
II[ PlayerInfo[ playerid ][ xProperty ][ 1 ] ][ iNeaktivnost ] = 0;
//SaveProperty( PlayerInfo[ playerid ][ xProperty ][ 1 ] );
sql_update_property(PlayerInfo[playerid][xProperty][1], "iNeaktivnost", 0);
}
if( PlayerInfo[ playerid ][ xProperty ][ 2 ] != -1 )
{
II[ PlayerInfo[ playerid ][ xProperty ][ 2 ] ][ iNeaktivnost ] = 0;
//SaveProperty( PlayerInfo[ playerid ][ xProperty ][ 2 ] );
sql_update_property(PlayerInfo[playerid][xProperty][2], "iNeaktivnost", 0);
}

    new q[120];
mysql_format(_dbConnector, q, sizeof(q), "SELECT * FROM `staff` WHERE `aTID` = '%d' LIMIT 1", PlayerInfo[playerid][xID]);
mysql_pquery(_dbConnector, q, "sql_load_staff", "i", playerid);

INI_ParseFile( KladIme( playerid ), "LoadKladionica", .bExtra = true, .extra = playerid );


    new datum[ 64 ], year, month, day;
getdate( year, month, day );
new tmphour, tmpminute, tmpsecond;
gettimeEx( tmphour, tmpminute, tmpsecond );
FixHour( tmphour );
tmphour = shifthour;
format( datum, sizeof( datum ), "%02d/%02d/%d - %d/%d/%d", day, month, year, tmphour, tmpminute, tmpsecond );
strmid( PlayerInfo[ playerid ][ xLastLogin ], datum, 0, strlen( datum ), 64 );
    if( PlayerInfo[ playerid ][ xSlotoviVozila ] < MAX_VEH_SLOT )
{
if( PlayerInfo[ playerid ][ xLevel ] > 5 && PlayerInfo[ playerid ][ xSlotoviVozila ] < 2 )
{
PlayerInfo[ playerid ][ xSlotoviVozila ]++;
SendClientMessageEx( playerid, ZUTA, "Dobili ste dodatni slot vozila jer ste presli level 5(Sada imate %d).", PlayerInfo[ playerid ][ xSlotoviVozila ] );

sql_user_update_integer( playerid, "vehicle_slots", PlayerInfo[ playerid ][ xSlotoviVozila ] );

}

if( PlayerInfo[ playerid ][ xLevel ] > 10 && PlayerInfo[ playerid ][ xSlotoviVozila ] < 3 )
{
PlayerInfo[ playerid ][ xSlotoviVozila ]++;
SendClientMessageEx( playerid, ZUTA, "Dobili ste dodatni slot vozila jer ste presli level 10(Sada imate %d).", PlayerInfo[ playerid ][ xSlotoviVozila ] );

sql_user_update_integer( playerid, "vehicle_slots", PlayerInfo[ playerid ][ xSlotoviVozila ] );

}
} [/code
Lepo on ucita igraca .


*
Trening kamp: 15/20

Uslikaj liniju 30122

 Str: [1]   Gore   « natrag naprijed »
 

© 2011 - 2019, SA:MP zajednica Zapadni Balkan. All rights reserved.