Jump to content
  • 0

Pica server


Cordyandrey

Question

Salutare!

Vin cu o intrebare am luat un GM de tip Burned de pe net pare destul de ok, insa e o problema. 

Eu cand cumpar o masina din DS imi da ban fara un motiv anume fix dupa textul "Cordy si-a luat o masina de tip Bravura. etc Dupa textul cam la 3 secunde iau ban de multe ori dupa relog merge bine insa nu mai pot tasta comanda /v.. Ma uit in chat-log sa vad ce se petrece si apare asta cand dau /v

[14:16:01] [debug] Run time error 4: "Array index out of bounds"
[14:16:01] [debug]  Accessing element at negative index -400
[14:16:01] [debug] AMX backtrace:
[14:16:01] [debug] #0 0014aa60 in ?? (0) from gmm.amx
[14:16:01] [debug] #1 001442d0 in public @_yCv (0, 60123348, 0) from gmm.amx
[14:16:01] [debug] #2 0014427c in public @yC_v (0, 60123348, 0, 0) from gmm.amx
[14:16:01] [debug] #3 native CallRemoteFunction () from sampsvr-port_543
[14:16:01] [debug] #4 00036f14 in ?? (0, 60123336, 0) from gmm.amx
[14:16:01] [debug] #5 00036758 in ?? (0, 60123336) from gmm.amx
[14:16:01] [debug] #6 00029124 in public OnPlayerCommandText (0, 60123336) from gmm.amx

Si in log mai apare asta dupa ce imi cumpar o masina si primesc ban:

[14:26:30] [debug] Run time error 4: "Array index out of bounds"
[14:26:30] [debug]  Accessing element at negative index -400
[14:26:30] [debug] AMX backtrace:
[14:26:30] [debug] #0 0014aa60 in ?? (0) from gmm.amx
[14:26:30] [debug] #1 001442d0 in public @_yCv (0, 60123348, 0) from gmm.amx
[14:26:30] [debug] #2 0014427c in public @yC_v (0, 60123348, 0, 0) from gmm.amx
[14:26:30] [debug] #3 native CallRemoteFunction () from sampsvr-port_543
[14:26:30] [debug] #4 00036f14 in ?? (0, 60123336, 0) from gmm.amx
[14:26:30] [debug] #5 00036758 in ?? (0, 60123336) from gmm.amx
[14:26:30] [debug] #6 00029124 in public OnPlayerCommandText (0, 60123336) from gmm.amx
[14:26:35] Cordy si-a cumparat un Perrenial[13].
[14:26:36] [warning] client exceeded 'ackslimit' xxxxxxxxxx(aici era ip) (1044) Limit: 1000/sec
[14:26:47] [part] Cordy has left the server (0:0)

Ma gandesc sa fie problema de la host zic eu, preciez ca am host gratuit de la Ultra-H (il tin asa sa modific chestii prin el pana am sa-l bag eu pe un host mai bun), cred ca e de la asta, iar daca ma insel va rog sa-mi spuneti!

A da, pe localhost merge foarte bine!

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Uite @Kiran aceasta e comanda

YCMD:buycar(playerid, params[], help) {
    if(PlayerInfo[playerid][pLevel] < 3) return SCM(playerid, COLOR_GREY, "Nu ai nivel 3!");
    if(!PlayerToPoint(3.0,playerid,326.9715,-1514.7264,36.0325)) return SCM(playerid, COLOR_GREY, "Nu esti la dealership.");
    if(TestingModel[playerid] == 1) return 1;
            
    if(PlayerInfo[playerid][pWantedLevel] > 0) return SCM(playerid, -1, "Ai wanted, nu poti folosi aceasta comanda!");
    new x=0, dbID[180], szQuery[256];
    format(szQuery, sizeof(szQuery), "SELECT * FROM `dsveh`");
    new Cache: result = mysql_query(SQL, szQuery);
    for(new i, j = cache_get_row_count (); i != j; ++i)
    {
        cache_get_field_content(i, "ID", dbID);
        x++;
        SelectedCar[playerid][x] = strval(dbID);
        LastDealerCar[playerid] = strval(dbID);
    }
    cache_delete(result);
    TestingModel[playerid] = 0;
    TotalDealerCars[playerid] = x;
    DealerCarType[playerid] = 1;
    InDealer[playerid] = 1;
    TogglePlayerControllable(playerid, 0);
    SetPlayerVirtualWorld(playerid, playerid+1);
    SetPlayerInterior(playerid, 0);
    SetPlayerPosEx(playerid, -2329.9380, 185.0620, 37.8267);
    DealerID[playerid] = 1;
    DealerCarColor1[playerid] = 1;
    DealerCarColor2[playerid] = 1;
    DealerCarAngle[playerid] = -61.3200;
    DealerCar[playerid] = CreateVehicleEx(DSModels[DealerID[playerid]][dModel],-2472.2488, 2235.5156, 4.6536,DealerCarAngle[playerid],DealerCarColor1[playerid],DealerCarColor2[playerid],-1);
    SetVehicleVirtualWorld(DealerCar[playerid],playerid+1);
    LinkVehicleToInterior(DealerCar[playerid], 0);
    PutPlayerInVehicleEx(playerid, DealerCar[playerid], 0);
    new string[128];
    format(string, sizeof(string), "Color 1: %d~n~Color 2: %d", DealerCarColor1[playerid], DealerCarColor2[playerid]);
    PlayerTextDrawSetString(playerid, DSTds[4], string);
    PlayerTextDrawShow(playerid, DSTds[4]);        
    PlayerTextDrawSetPreviewModel(playerid, DSTds[2], DSModels[DealerID[playerid]][dModel]);    
    PlayerTextDrawSetPreviewModel(playerid, DSTds[2], DSModels[DealerID[playerid]][dModel]);
    PlayerTextDrawSetPreviewVehCol(playerid, DSTds[2], DealerCarColor1[playerid], DealerCarColor2[playerid]);
    PlayerTextDrawShow(playerid, DSTds[2]);        
    ShowDealershipTextdraws(playerid);
    SelectTextDraw(playerid, 0x2EA1FFFF);    
    ShowCamera(playerid);    
    return 1;
}
 

Link to comment
Share on other sites

  • 0

Eu am gasit asta..

new randspawn = random(sizeof(DealerCarPos));
            CarInfo[idd][cLocationx] = DealerCarPos[randspawn][0];    CarInfo[idd][cLocationy] = DealerCarPos[randspawn][1];    CarInfo[idd][cLocationz] = DealerCarPos[randspawn][2];
            CarInfo[idd][cAngle] = DealerCarPos[randspawn][3];
            SetPlayerCheckpointEx(playerid,CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],5.0);
        }
        
        CarInfo[idd][cColorOne] = DealerCarColor1[playerid];    CarInfo[idd][cColorTwo] = DealerCarColor2[playerid];
        strmid(CarInfo[idd][cOwner], PlayerInfo[playerid][pUsername], 0, strlen(PlayerInfo[playerid][pUsername]), 255);
        CarInfo[idd][cValue] = DSModels[SelectedCar[playerid][DealerID[playerid]]][dPrice];
        strmid(CarInfo[idd][cLicense], "NewCar", 0, 6, 255);
        CarInfo[idd][cAlarm] = 0;    CarInfo[idd][cLock] = 0;
        CarInfo[idd][mod0] = 0;        CarInfo[idd][mod1] = 0;        CarInfo[idd][mod2] = 0;        CarInfo[idd][mod3] = 0;
        CarInfo[idd][mod4] = 0;        CarInfo[idd][mod5] = 0;        CarInfo[idd][mod6] = 0;        CarInfo[idd][mod7] = 0;
        CarInfo[idd][mod8] = 0;        CarInfo[idd][mod9] = 0;        CarInfo[idd][mod10] = 0;    CarInfo[idd][mod11] = 0;
        CarInfo[idd][mod12] = 0;    CarInfo[idd][mod13] = 0;    CarInfo[idd][paintjob] = 3;    CarInfo[idd][KM] = 0;
        CarInfo[idd][cPoints] = 5; CarInfo[idd][cTax] = 3000;
        saveCar(idd);

Link to comment
Share on other sites

  • 0

uite daca te ajuta asta

    CarInfo[idd][Spawned] = CreateVehicleEx(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],CarInfo[idd][cColorOne],CarInfo[idd][cColorTwo],-1);
        VehicleOwned[CarInfo[idd][Spawned]] = CarInfo[idd][Spawned];
        VehicleSQL[CarInfo[idd][Spawned]] = idd;    
        new e,l,aa,d,b,bo,o;
        GetVehicleParamsEx(idd,e,l,aa,d,b,bo,o);
        SetVehicleParamsEx(idd,0,l,aa,d,b,bo,o);
        SetVehicleNumberPlate(CarInfo[idd][Spawned],CarInfo[idd][cLicense]);
        DestroyVehicle(DealerCar[playerid]);
        TogglePlayerControllable(playerid, 1);
        SetCameraBehindPlayer(playerid);
        SetPlayerVirtualWorld(playerid,0);
        SetPlayerPosEx(playerid, 326.9715,-1514.7264,36.0325);
        SetPlayerInterior(playerid, 0);
        
        if(InDealer[playerid] == 1) GivePlayerCash(playerid, -DSModels[SelectedCar[playerid][DealerID[playerid]]][dPrice]);
        else PlayerInfo[playerid][pPremiumPoints] -= DSModels[SelectedCar[playerid][DealerID[playerid]]][dGold];            
        if(InDealer[playerid] == 1) {
            format(string, sizeof(string), "Felicitari! Ai cumparat un %s pentru %s$. ",aVehicleNames[DSModels[SelectedCar[playerid][DealerID[playerid]]][dModel]-400],FormatNumber(CarInfo[idd][cValue]));
            SCM(playerid,COLOR_MONEY,string);
        }
        else {
            format(string, sizeof(string), "Felicitari! Ai cumparat un %s pentru %s puncte premium. ",aVehicleNames[DSModels[SelectedCar[playerid][DealerID[playerid]]][dModel]-400],DSModels[SelectedCar[playerid][DealerID[playerid]]][dGold]);
            SCM(playerid,COLOR_MONEY,string);
        }
        
        format(string, sizeof(string), "%s si-a cumparat un %s[%d].", GetName(playerid), aVehicleNames[DSModels[SelectedCar[playerid][DealerID[playerid]]][dModel]-400], idd);
        SendAdminMessage(COLOR_YELLOW, string, 1); 
        InsertLog(playerid, string, LOG_CAR);    
        
        finishAchievement(playerid, 1);        
        InDealer[playerid] = 0;
        SetPlayerCheckpointEx(playerid,CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],5.0);
        CancelSelectTextDraw(playerid);
        HideDealershipTextdraws(playerid);            
    }
    if(playertextid == ExitDS) {
        CancelSelectTextDraw(playerid);
        HideDealershipTextdraws(playerid);
        if(InDealer[playerid] == 1) SetPlayerPosEx(playerid, 326.9715,-1514.7264,36.0325);
        else if(InDealer[playerid] == 2) SetPlayerPosEx(playerid, 326.9715,-1514.7264,36.0325);
        InDealer[playerid] = 0;
        DealerCategory[playerid] = 0;
        DealerCarColor1[playerid] = 0;
        DealerCarColor2[playerid] = 0;
        DealerCarAngle[playerid] = 0;
        SetCameraBehindPlayer(playerid);
        TogglePlayerControllable(playerid, 1);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
        DestroyVehicle(DealerCar[playerid]);
        DealerCar[playerid] = 0;
        DealerCarType[playerid] = -1;
        TestingModel[playerid] = 0;
        PlayerPlaySound(playerid, 1085, 0.0, 0.0, 10.0);
    }

Link to comment
Share on other sites

  • 0

Asta e problema ca nu setezi deloc modelul. Ar trebui sa ai ceva de genul:

CarInfo[idd][cModel] = model;

Acum sa iti spun sincer habar nu am cum iei modelul masini cumparate in dealer

CarInfo[idd][cModel] = SelectedCar[playerid][DealerID[playerid]]][dModel];

Presupun ca asa, habar nu am. 

Link to comment
Share on other sites

  • 0

Ok se pare ca acum in Server-log nu mai sunt erorile alea urate.. acum apare doar asta cand imi iau masina si pica serverul:

[16:30:40] Cordy si-a cumparat un Perrenial[14].
[16:30:41] [warning] client exceeded 'ackslimit' xxxxxxxxxx(aici era ip meu) (1027) Limit: 1000/sec
[16:30:52] [part] Cordy has left the server (0:0)
[16:32:55] [connection] incoming connection: xxxxxxxxxx id: 0
[16:32:56] [join] Cordy has joined the server (xxxxxxxx5)
[16:33:01] Cordy has logged in with IP xxxxxxxxxx5.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.