Jump to content

andreistalker

Membru
  • Posts

    23
  • Joined

  • Last visited

Posts posted by andreistalker

  1. Poziţie: Scripter
    Ce servicii pot oferi: Pot oferii servicii de scripter free in gamemode-urile RP/GodFather, cu conditia sa aiba host.
    Alte detalii: Detin un Gamemode RP, momentan neterminat.

    Contact skype: gigibecali33

  2. Problema intalnita (descriere): Nu face load la float-uri mysql
    Ero(area / rile) / warning-(ul / urile): warning 213: tag mismatch
    Liniile de cod / sursa / script-ul(obligatoriu):

    P_Data[playerid][pCar1] = cache_get_field_content_int(0, "Car1");
            P_Data[playerid][pCarID1] = cache_get_field_content_int(0, "CarID1");
            P_Data[playerid][pCarColor11] = cache_get_field_content_int(0, "CarColor11");
            P_Data[playerid][pCarColor21] = cache_get_field_content_int(0, "CarColor21");
            P_Data[playerid][pCarPlate1] = cache_get_field_content(0, "CarPlate1", plate1[playerid]);
            P_Data[playerid][pCarHealth1] = cache_get_field_content_float(0, "CarHealth1");
            P_Data[playerid][pCarX1] = cache_get_field_content_float(0, "CarX1");
            P_Data[playerid][pCarZ1] = cache_get_field_content_float(0, "CarZ1");
            P_Data[playerid][pCarY1] = cache_get_field_content_float(0, "CarY1");
            P_Data[playerid][pCarR1] = cache_get_field_content_float(0, "CarR1");
            P_Data[playerid][pCarID2] = cache_get_field_content_int(0, "CarID2");
            P_Data[playerid][pCarColor12] = cache_get_field_content_int(0, "CarColor12");
            P_Data[playerid][pCarColor22] = cache_get_field_content_int(0, "CarColor22");
            P_Data[playerid][pCarPlate2] = cache_get_field_content(0, "CarPlate2", plate2[playerid]);
            P_Data[playerid][pCarHealth2] = cache_get_field_content_float(0, "CarHealth2");
            P_Data[playerid][pCarX2] = cache_get_field_content_float(0, "CarX2");
            P_Data[playerid][pCarZ2] = cache_get_field_content_float(0, "CarZ2");
            P_Data[playerid][pCarY2] = cache_get_field_content_float(0, "CarY2");
            P_Data[playerid][pCarR2] = cache_get_field_content_float(0, "CarR2");


    Imagini / Video (optional):
    Ati incercat sa rezolvati singur?: Da

     

    Toate float-urile dau warningu ala

  3. Am gasit pe internet un tutorial de vehicle System pe mysql si era pe o versiune veche, cum as putea sa o trec pe r39?

    public LoadCar()
    {
        new vehs = 0;
        mysql_query(handle,"SELECT MAX(id) FROM cars");
        mysql_store_result();
        masini = mysql_fetch_int();
        for(new idx = 1; idx <= masini; idx++)
        {
            new query[256];
            mysql_format(handle, query, sizeof(query), "SELECT * FROM cars WHERE ID = %d",idx);
            mysql_query(handle, query);
            mysql_store_result();
            if(cache_num_rows())
            {
                CarInfo[idx][cID] = -2;
            }
            else
            {
                if(mysql_fetch_row_format(query, "|"))
                {
                    sscanf(query, "p<|>e<iiffffiis[25]is[14]iiiiiiiiiiiiiiiiiiiii>",CarInfo[idx]);
                    vehs++;
                }
            }
        }
        mysql_free_result();
        printf("Cars: %d", vehs);
        return 1;
    }

     

    Multumesc celor care o sa ma ajute :D

  4. Iti explic cum l-am facut eu, eu il am pe MySql,Faci o variabila P_Data[playerid][pAdmin] care o salvezi in dini nu stiu cum.... si faci o comanda care ii modifici P_Data[playerid][pAdmin] in ce vrei tu si apoi pui if(P_Data[playerid][pAdmin] >= 1) adica daca are admin mai mare ca unu. Eu iti dau un exemplu de gandire

  5. Pozitie: scripter

    Ce servicii pot oferi: Am un gamemode RPG facut de la 0 nu edit care nu are buguri si doresc un partener cu care sa deschidem o comunitate

    Alte detalii: Sa fie o persoana serioasa si sa poata cumpara un Host Pentru Samp

     

  6. Am incercat sa rezolv si am rezolvat-o 50% adica cand scriu /stats imi arata banii, dar banii nu se trimit si la database, aceeasi problema am si cand folosesti /ban nu trimite Ban = 1 la database, astea 2 sunt probleme...

    Am rezolvat-o, dar acum nu imi mai da banii la connect :)))) MENTIONEZ: PANA ACUM MERGEA

    public OnLogin(playerid)
    {
        new rows, fields,temporar[200];
        cache_get_data(rows, fields);
        if(rows)
        {
            P_Data[playerid][pParola] = cache_get_field_content(0, "Parola",temporar);
            P_Data[playerid][pID] = cache_get_field_content_int(0, "ID");
            P_Data[playerid][pCash] = cache_get_field_content_int(0, "Cash");
            P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
            P_Data[playerid][pHelper] = cache_get_field_content_int(0, "Helper");
            P_Data[playerid][pLevel] = cache_get_field_content_int(0, "Level");
            SpawnPlayer(playerid);
            GivePlayerMoney(playerid, P_Data[playerid][pCash]);
            SpawnPlayer(playerid);
            gLogged[playerid] = 1;
            SpawnPlayer(playerid);
        }
        else
        {
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit");
        }
        return 1;
    }

     

  7. Problema intalnita (descriere): Nu stiu cum ar trebui sa fac ca sa se trimita banii la toti playerii
    Ero(area / rile) / warning-(ul / urile): -
    Liniile de cod / sursa / script-ul(obligatoriu):

    forward updatemoney();
    public updatemoney()
    {
    
    new query[256];
    	foreach(Player, i)
    		mysql_format(handle, query, sizeof(query), "UPDATE 'conturi' SET 'Cash' = '%d' WHERE 'Nume' = '%s'",
     ----, ----);
            mysql_query(handle, query);
    	return 1;
    }


    Imagini / Video (optional): -
    Ati incercat sa rezolvati singur?: La MySql format cum ar trebui sa fac ca sa il timita?

  8. Problema: Pasagerul poate porni/opri masina

    Cod:

    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    if(newkeys & KEY_SUBMISSION)// tasta 2
    
        {
    
            new vehicleid = GetPlayerVehicleID(playerid);
    
            if(vehicleid == INVALID_VEHICLE_ID)
    
                    return SendClientMessage(playerid,-1,"Eroare:{FF0000}Nu esti intr-un vehicul!");
    
    
    
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    
    
            if(EngineVehicle[vehicleid] == 0) //EngineVehicle == 0 == Stop
    
            {
    
    	SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
    
        new String[256];
        format(String,sizeof(String),"{FFFF00}Ai pornit motorul la {FF0000}%s.",GetVehicleName(vehicleid));
    	SendClientMessage(playerid,-1,String);
    
    
    
                EngineVehicle[vehicleid] = 1;
    
            }
    
            else if(EngineVehicle[vehicleid] == 1) //EngineVehicle == 1 = Started
    
            {
                SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    
    	new String[256];
    
        format(String,sizeof(String),"{FFFF00}Ai oprit motorul la {FF0000}%s.",GetVehicleName(vehicleid));
    	SendClientMessage(playerid,-1,String);
    
    
    
                EngineVehicle[vehicleid] = 0;
    
            }
    
        }
    	return 1;
    }

     

  9. Am 2 probleme care nu stiu cum sa le rezolv

    Problema intalnita (descriere): Am incercat sa fac cand te deconectezi de la server sa iti salveze bani, dar nu merge...
    Ero(area / rile) / warning-(ul / urile): -
    Liniile de cod / sursa / script-ul(obligatoriu): 

    public OnPlayerDisconnect(playerid, reason)
    {

        new query[126];
        mysql_format(handle, query, sizeof(query), "UPDATE `players` SET `Cash`='%s' WHERE `username`='%s'", GetPlayerMoney(playerid), GetPlayerName(playerid));// facem update-ul la baza de date
         mysql_query(handle, query);

        return 1;
    }
    Ati incercat sa rezolvati singur?: Da

    Problema #2

    Problema intalnita (descriere): Atunci cand te respawnezi iti ia 100$
    Ati incercat sa rezolvati singur?: Da

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.