Jump to content
  • 0

Problema salvare numar / tuning masina


adyi

Question

Nume:Adyi

Problem? întâlnit?: La servarul meu de samp daca imi pun un numar de inmatriculare se pune la masina totutl bine ramane dar dupa ce dau un restart la srv masina are numaru XYZQRL ceva de genu nu are numarul care a fost pus. P.s Servarul este pe baza de date MYSQL si in bza de date ramane salvat numarul si dupa restart daca ma uit in baza d edate la o masina are numarul pus dar in joc dupa gmx dipsare numarul .. Daca stie cineva ceva va rog mult

Si mai am o problema asemanatoare. nu se salveaza tuningul la masina dupa restart la fel ca la numar merge totul bine dar dupa restart ramane masina ne tunat .. Va rog mult

Ps. Insist sa spun ca pe baza de date ramane salvat componentele si nr de inmatriculare dar cand intru pe srv dupa restart nu apare nimic ...  ar ceva la pornirea servarului nu citeste acele date cum asi putea rezolva Multumesc

Ce am încercat pân? acum: pai am incercat multe am modificat comanda dar intr-un final am lasat originala ..

Codul sursa/Log/Altele: Nu am ce cod sa pun .. comanda ?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Incarca ceea ce nu incarca este numarul de inamtriculare si tuningul dar in rest pretu masini si retu incarca uite comanda de inmatriculat

[pawn] if(strcmp(cmd, "/inscriemasina", true) == 0)

{

    if(PlayerToPoint(25.0, playerid, 359.2910,182.4579,1008.3828) || PlayerToPoint(5.0, playerid, 841.0918, -22.6525, 1006.6228))

    {

        if(PlayerInfo[playerid][pPcarkey] != 999)

        {

           

if(PlayerInfo[playerid][pCash] < 10000)

{

    SendClientMessage(playerid, COLOR_LIGHTRED, "Server:{FFFFFF} Nu ai destui bani. (10.000$)");

    return 1;

}

                GetPlayerName(playerid, sendername, sizeof(sendername));

new length = strlen(cmdtext);

while ((idx < length) && (cmdtext[idx] <= ' '))

{

idx++;

}

new offset = idx;

new result[255];

while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

{

result[idx - offset] = cmdtext[idx];

idx++;

}

result[idx - offset] = EOS;

for(new s = 0; s < num_words; s++)

{

new pos;

while((pos = strfind(result,Swears,true)) != -1) for(new i = pos, j = pos + strlen(Swears); i < j; i++)

{

result = '*';

}

}

if(!strlen(result))

{

SendUsage(playerid, "  /inscriemasina [numar]");

return 1;

}

if(strfind(result, "|", true) != -1)

{

    SendClientMessage(playerid, COLOR_LIGHTRED, "Server: {ffffff}{FF0000}ErroR.");

    return 1;

}

else

{

moneys = PlayerInfo[playerid][pPcarkey];

  strmid(CarInfo[moneys][cNum], result, 0, strlen(result), 999);

    format(string, sizeof(string), "%s a inscris %s -ul (id: %d). Noul numar este %s",PlayerInfo[playerid][pNume],CarInfo[moneys][cDescription],moneys+PreVehicle,CarInfo[moneys][cNum]);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

                format(string, sizeof(string), "%s",CarInfo[moneys][cNum]);

SetVehicleNumberPlate(moneys+PreVehicle, string);

GivePlayerCash(playerid, -10000);

format(string, sizeof(string), "UPDATE cars SET Num='%s' WHERE id=%d", CarInfo[moneys][cNum], moneys);

mysql_query(string);

BizzInfo[2][bTill] += 10000;

ExtortionBiz(2, 10000);

format(string, sizeof(string), "UPDATE bizz SET Till='+10000' WHERE id=2");

mysql_query(string);

BizzInfo[2][bProducts]--;

format(string, sizeof(string), "UPDATE cars SET Num='%s' WHERE id=%d", CarInfo[moneys][cNum], moneys);

mysql_query(string);

  return 1;

}

}

else

{

    SendClientMessage(playerid, COLOR_LIGHTRED, "Server:{FFFFFF} Nu ai vreo masina personala.");

return 1;

}

}

SendClientMessage(playerid, COLOR_LIGHTRED, "Server:{FFFFFF} Nu esti la primarie / Inscrieri Masini.");

return 1;

}[/pawn]

Si asta este LodCar

[pawn]public LoadCar()

{

  //  new query[255];

    new Query[255];

    mysql_query("SELECT * FROM cars"); // Querys the "Query" Variable.

    mysql_store_result(); // Stores the result from Query

  //  personalcars = mysql_num_rows();

// new masini=0;

    for(new idx = 527; idx <= 999; idx++)

{

    SetVehicleNumberPlate(idx, CarInfo[ idx ][ cNum ] );

    format(Query, sizeof(Query), "SELECT * FROM cars WHERE id = '%d'", idx);

        mysql_query(Query); // Querys the "Query" Variable.

        mysql_store_result(); // Stores the result from Query

        if(mysql_num_rows()) // Checks if theres anyrow.

        if(mysql_fetch_row_format(Query,"|")) // Splits the row

        {

sscanf(Query, "p<|>e<iiffffffffiis[64]s[64]iiiiiiis[255]iiiiiiiiiiiiii>",CarInfo[idx-PreVehicle]);

}

}

printf("[AF]Au fost incarcate masinile personale!");

return 1;

}[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.