SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Română/Romanian

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 07/11/2011, 12:31 PM   #1
tsubasa11
Big Clucker
 
Join Date: Jan 2011
Posts: 138
Reputation: 1
Default Masinile din baza de date

Buna.... Pentru cei care ma pot ajuta uitati ce am incercat :

In functia OnGameModeInit() am adaugat niste masini care le scot din baza de date asa:

pawn Code:
mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_DB,MYSQL_PASS);


  mysql_debug(1);

    new string22[556];
    format(string22, sizeof(string22), "SELECT * FROM `vehicles`");
    mysql_query(string22);

    mysql_store_result();
    new rows;
    rows = mysql_num_rows();



    new unu;
    unu=1;

    new string123[556];


    new vektor2[556];
   
    new model;
    new Float:x;
    new Float:y;
    new Float:z;
    new Float:angle;
    new color1;
    new color2;


    mysql_debug(1);
   
mysql_free_result();

    while(unu<=rows)
    {

   
    format(string123, sizeof(string123), "SELECT `model`, x`, `y`, `z`, `angle`, `color1`, `color2`  FROM `users` WHERE `id` = '%d'",unu);
    mysql_query(string123);

    mysql_store_result();


    mysql_fetch_row(vektor2);

    mysql_fetch_field_row(string123, "model");
    model = strval(string123);

    mysql_fetch_field_row(string123, "x");
    x = strval(string123);

    mysql_fetch_field_row(string123, "y");
    y = strval(string123);

    mysql_fetch_field_row(string123, "z");
    z = strval(string123);

    mysql_fetch_field_row(string123, "angle");
    angle = strval(string123);
   
    mysql_fetch_field_row(string123, "color1");
    color1 = strval(string123);
   
    mysql_fetch_field_row(string123, "color2");
    color2 = strval(string123);
   

   

     AddStaticVehicle(model,x,y,z,angle,color1,color2);


    mysql_free_result();

    unu=unu+1;
    }

Nu adauga deloc masinile .




Nu stiu, oare de ce ?

Last edited by tsubasa11; 08/11/2011 at 07:54 PM.
tsubasa11 is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nu se adauga masinile la factiune ! Mr.Sphirit Română/Romanian 21 12/11/2010 10:55 PM
O problema cu masinile SanduMihai Română/Romanian 2 12/07/2010 06:46 PM
Un nou forum, aceeasi baza de date. [NoV]LaZ Română/Romanian 3 06/07/2010 02:50 PM
Citi va rog frumos....Trb cu masinile Lukian2 Română/Romanian 9 09/02/2010 12:19 PM
[FS/MAP]Baza king s dm Filterscripts 9 29/03/2009 01:31 PM


All times are GMT. The time now is 02:03 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.