SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Archive

 
 
Thread Tools Display Modes
Old 29/05/2012, 04:49 PM   #1
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Svea Rike
Posts: 1,508
Reputation: 64
Question MySQL problem

Har lite problem med mina buildings på samp när jag lägger in en ny i mitt script så kommer det inte upp in game men står att den loadar den.

pawn Code:
forward LoadBuilding();
public LoadBuilding()
{
    new arrCoords[11][64];
    new sql[80], row[512];
    format(sql, sizeof(sql), "SELECT COUNT(*) FROM Buildings");
    mysql_query(sql);
    mysql_store_result();
    mysql_fetch_row(row);
    totalbuildings = 10;
    mysql_free_result();

    for (new idx=0; idx<totalbuildings; idx++)
    {
        format(sql, sizeof(sql), "SELECT * FROM Buildings WHERE BuildingID=%d", idx);
        mysql_query(sql);
        mysql_store_result();
        if (mysql_num_rows() > 0)
        {
            mysql_fetch_row(row);
            split(row, arrCoords, '|');
            mysql_free_result();
            Building[idx][EnterX] = floatstr(arrCoords[1]);
            Building[idx][EnterY] = floatstr(arrCoords[2]);
            Building[idx][EnterZ] = floatstr(arrCoords[3]);
            Building[idx][PickupID] = strval(arrCoords[4]);
            Building[idx][ExitX] = floatstr(arrCoords[5]);
            Building[idx][ExitY] = floatstr(arrCoords[6]);
            Building[idx][ExitZ] = floatstr(arrCoords[7]);
            strmid(Building[idx][BuildingName], arrCoords[8], 0, strlen(arrCoords[8]), 255);
            Building[idx][ExitInterior] = strval(arrCoords[9]);
            Building[idx][Custom] = strval(arrCoords[10]);

            //Building[idx][PickupID] = CreateStreamPickup(1239, 1, Building[idx][EnterX], Building[idx][EnterY], Building[idx][EnterZ],15);
            CreateDynamicPickup(1318, 1, Building[idx][EnterX], Building[idx][EnterY], Building[idx][EnterZ], -1, -1, -1, 40.0);
        }
    }
    mysql_free_result();
    printf("%d Buildings loaded from database", totalbuildings);
    return true;
}
__________________
Check out our forum http://rebound-rp.com
N0FeaR is offline  
Old 31/05/2012, 10:33 AM   #2
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Svea Rike
Posts: 1,508
Reputation: 64
Default Re: MySQL problem

nvm, har fixat det nu.
__________________
Check out our forum http://rebound-rp.com
N0FeaR is offline  
Old 31/05/2012, 09:40 PM   #3
Lorrden
Huge Clucker
 
Lorrden's Avatar
 
Join Date: Sep 2007
Location: کωعdعи
Posts: 443
Reputation: 0
Default Re: MySQL problem

Bra om du skriver vad felet var ifall någon annan har samma problem!
__________________


★ Small Town (Heavy) Roleplay ★ 100% Unique Script ★ Experienced Staff (8+ years of SA-MP) ★ Friendly, Mature Members ★
Join Us Today - PC-RP.NET:7777
Lorrden is offline  
Old 01/06/2012, 09:40 AM   #4
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Svea Rike
Posts: 1,508
Reputation: 64
Default Re: MySQL problem

Jag gjorde om system asså tog bort LoadBuilding från min mysql och la in det i scriptet iställe.
__________________
Check out our forum http://rebound-rp.com
N0FeaR is offline  
 

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
Hosting problem or MYSQL problem? Smacky Scripting Help 0 16/04/2012 04:42 PM
problem with MySQL mineralo Scripting Help 2 08/02/2012 03:43 PM
Problem with reading money from MySQL in "Clean, Simple MySQL GM" by L3th4l Dystans Help Archive 1 31/05/2011 09:19 PM
MySQL problem multinfs Server Support 2 26/11/2010 06:05 PM
problem with CWRP in linux (mysql problem) BSMan Server Support 1 16/06/2009 02:36 PM


All times are GMT. The time now is 04:19 AM.


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