Jump to content

[RW]Robi

Membru
  • Posts

    292
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by [RW]Robi

  1. CMD:dsprice(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(playerVariables[playerid][pAdminLevel] < 6) return S(playerid, -1, AdminOnly); new pret,id,sqlselect[300],eroare = 0; if(sscanf(params, "ii", id,pret)) return S(playerid, COLOR_GREY, "Syntax: {FFFFFF}/dsprice [id stock (db)] [pret]"); mysql_format(handle, sqlselect, sizeof(sqlselect), "SELECT * FROM `stock` WHERE `ID`='%d'",id); new Cache: verificare = mysql_query(handle, sqlselect); eroare = cache_get_row_count(); cache_delete(verificare); if(eroare < 1) return SendClientMessage(playerid, -1, "Nu exista acel vehicul in stock."); Stock[id][vPrice] = pret; mysql_format(handle, sqlselect, sizeof(sqlselect), "UPDATE `stock` SET `Price`= '%d' WHERE `ID`= '%d'", Stock[id][vPrice], id); mysql_tquery(handle, sqlselect, "",""); format(string, sizeof(string), "{F0DF52}/dsprice: Owner %s changed data for %s | Price: $%s", GetName(playerid), Stock[id][vName], NumberFormat(pret)); submitToAdmins(string, -1); } return 1; }
  2. Nu are cum, cred ca nu s-a compilat pentru ca am uitat sa pun idm++ schimba cu asta CMD:dsprice(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(playerVariables[playerid][pAdminLevel] < 6) return S(playerid, -1, AdminOnly); new tableid, car[10], price, stockk, query[256], string[256]; if(sscanf(params, "s[10]di", car, price, stockk)) return S(playerid, COLOR_GREY, "Syntax: {FFFFFF}/dsprice [vehicleid] [price] [stock]"); tableid = MySQLCheckCar(car); if(tableid == 0) return S(playerid,COLOR_GREY,"Invalid car name."); for(new idm = 0; idm < MAX_DEALERSHIP_CARS; idm++) { if(strcmp(Stock[idm][vName],car,true) == 0) { Stock[idm][vStock] = stockk; Stock[idm][vPrice] = price; } } mysql_format(handle, query, sizeof(query), "UPDATE `stock` SET `Price`= '%d', `Stock`= '%d' WHERE `ID`= '%d'", Stock[tableid][vPrice], Stock[tableid][vStock], tableid); mysql_tquery(handle, query, "",""); format(string, sizeof(string), "{F0DF52}/dsprice: Owner %s changed data for %s | Price: $%s | Stock: %d", GetName(playerid), car, NumberFormat(price), stockk); submitToAdmins(string, -1); } return 1; }
  3. Nu iti seteaza cumva la a2-a masina? Ia incearca asta: CMD:dsprice(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(playerVariables[playerid][pAdminLevel] < 6) return S(playerid, -1, AdminOnly); new tableid, car[10], price, stockk, query[256], string[256]; if(sscanf(params, "s[10]di", car, price, stockk)) return S(playerid, COLOR_GREY, "Syntax: {FFFFFF}/dsprice [vehicleid] [price] [stock]"); tableid = MySQLCheckCar(car); if(tableid == 0) return S(playerid,COLOR_GREY,"Invalid car name."); for(new idm = 0; idm < MAX_DEALERSHIP_CARS; idm++) { if(strcmp(Stock[idm][vName],car,true) == 0) { Stock[idm][vStock] = stockk; Stock[idm][vPrice] = price; } } mysql_format(handle, query, sizeof(query), "UPDATE `stock` SET `Price`= '%d', `Stock`= '%d' WHERE `ID`= '%d'", Stock[tableid][vPrice], Stock[tableid][vStock], tableid); mysql_tquery(handle, query, "",""); format(string, sizeof(string), "{F0DF52}/dsprice: Owner %s changed data for %s | Price: $%s | Stock: %d", GetName(playerid), car, NumberFormat(price), stockk); submitToAdmins(string, -1); } return 1; }
  4. Da-ne repede comanda sa ti-o rezolvam si pe aia, si sa inchidem acest subiect.
  5. P.S: In caz ca in baza de date id-ul nu incepe de la 0 ci de la 1, foloseste asta: for ( new i = 1, j = cache_get_row_count ( ); i != j; i++) si schimba new x = i cu new x = i - 1;
  6. public IniStock() { new Cache: result1 = mysql_query (handle, "SELECT * FROM `stock` ORDER BY `Price`"); for ( new i = 0, j = cache_get_row_count ( ); i != j; i++) { new x = i; cache_get_field_content(i, "ID", result); x = strval(result); cache_get_field_content(i, "Stock", result); Stock[x][vStock] = strval(result); cache_get_field_content(i, "Price", result); Stock[x][vPrice] = strval(result); cache_get_field_content(i, "Model", result); Stock[x][vModel] = strval(result); cache_get_field_content(i, "Speed", result); Stock[x][vSpeed] = strval(result); cache_get_field_content(i, "Car", result); format(Stock[x][vName], 32, result); systemVariables[dsvehicle]++; } printf("[script] %d ds loaded.", systemVariables[dsvehicle]); cache_delete(result1); return 1; } CMD:buycar(playerid, params[]) { new stringzz[2000],stringy[2000]; for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++) { if(Stock[xf][vPrice] > 0 && Stock[xf][vPrice] <= 7000000) { format(stringy, sizeof(stringy), "%s ($%s)\n", Stock[xf][vName], NumberFormat(Stock[xf][vPrice])); strcat(stringzz,stringy); } } ShowPlayerDialog(playerid, DIALOG_CARBUY2, DIALOG_STYLE_LIST, "Buy a car", stringzz, "Select", "Back"); return 1; } La ondialogresponse if(dialogid == DIALOG_CARBUY2) { if(!response) return 1; if(listitem >= 0) { Functia care iti inserteaza masina sa zicem ca ai asa. InsertCar(playerid, Stock[listitem][vModel],Stock[listitem][vPrice]); } } Nu are ce sa nu mearga.
  7. Intr-un loop tu cresti pur si simplu o variabila pentru a-se oprii cand acesta ajunge la valoarea definita, ex: for(new i =0; i < 10; i++) { printf("%d",i); } Variabila incepe sa se numere de la 0 si se opreste la 9.
  8. Eu ma refeream ca nu e nici o diferenta daca folosesti ++i sau i++ intr-un loop.
  9. i++ si ++i e aceiasi chestie. Ia pune toata comanda buycar aici si dialogul de la buycar de la ondialogresponse.
  10. Si acum as vrea sa incep un GameMode de la 0, cu toate ca gamemodeul B-GAME este peste performantele din romania, insa cum spune si @KnowN, daca apare un bug sau ceva imediat iti dai seama de unde ar putea fi, asa trebuie sa cauti diferite cicatrici facute de alti ratati. De exemplu pe BigZone sistemul de case e buguit total, in unele comenzi cum ar fi /rentroom se seta casa in baza de date, dadeai /q reintra-i si casa era a ta. Deci, eu sustin creearea gamemodeurilor de la 0, insa gamemodeurile de la 0 sunt defavorizate de jucatori din romania, pentru ca ei nu pot intelege ca gamemodeul este la inceput si inca necesita adaugari, majoritatea vor sa joace pe un server ca bugged, doar sa vada cum e sa detii o functie, pentru ca stiu ca pe oficiala comunitate nu au sanse, sau nu au chef sa isi dea atat interes, venind pe o alta comunitate mai mica sansele sunt mai mari.
  11. Nimeni nu sta sa iti faca tie un sistem de licitatii, platesti si mai vedem.
  12. Nu iti dau toate comenzile, dar iti dau un exemplu. CMD:freezerange(playerid, params[]) { new raza; if(sscanf(params, "i",raza)) return SendClientMessage(playerid, -1, "/freezerange [raza]"); new XYZ[3]; GetPlayerPos(playerid, XYZ[0],XYZ[1],XYZ[2]); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInRangeOfPoint(i, raza, XYZ[0],XYZ[1],XYZ[2])) { TogglePlayerControllable(i, 0); } } } return 1; } (N-am testat-o, dar nu are ce sa nu mearga).
  13. Nu are rost sa va bateti capul cu el, un copil idiot care crede ca ii furam rahatului de gamemode de pe net. Cer T/C.
  14. Propun ca topicul sa fie inchis, creatorul refuza sa primeasca ajutor prin TW, pretinzand ca vrem sa-i furam faimosul GM.
  15. Da-mi datele TW in pm. EDIT: TW 11
  16. public IniStock() { new Cache: result1 = mysql_query (handle, "SELECT * FROM `stock` ORDER BY `Price`"); new x; for ( new i, j = cache_get_row_count ( ); i != j; ++i ) { cache_get_field_content(i, "ID", result); x = strval(result); cache_get_field_content(i, "Stock", result); Stock[x][vStock] = strval(result); cache_get_field_content(i, "Price", result); Stock[x][vPrice] = strval(result); cache_get_field_content(i, "Model", result); Stock[x][vModel] = strval(result); cache_get_field_content(i, "Speed", result); Stock[x][vSpeed] = strval(result); cache_get_field_content(i, "Car", result); format(Stock[x][vName], 32, result); systemVariables[dsvehicle]++; } printf("[script] %d ds loaded.", systemVariables[dsvehicle]); cache_delete(result1); return 1; } Nu are cum sa nu mearga ce ti-am dat eu mai sus...
  17. Hopa. e posibil sa iti arate invers, dami o poza cum iti arata, gen de la cel mai mare la cel mai mic.
  18. SA-MP-ul permite foarte multe, poti evolua acest joc foarte mult, daca ai posibilitatea de ce ramai la acel clasic, serios acum. Eu unul m-am saturat de gameplayul simplu din SA, vreau sa vad ceva diferit..
  19. public IniStock() { new Cache: result1 = mysql_query (handle, "SELECT * FROM `stock` ORDER BY `Price` DESC LIMIT 150"); new x; for ( new i, j = cache_get_row_count ( ); i != j; ++i ) { cache_get_field_content(i, "ID", result); x = strval(result); cache_get_field_content(i, "Stock", result); Stock[x][vStock] = strval(result); cache_get_field_content(i, "Price", result); Stock[x][vPrice] = strval(result); cache_get_field_content(i, "Model", result); Stock[x][vModel] = strval(result); cache_get_field_content(i, "Speed", result); Stock[x][vSpeed] = strval(result); cache_get_field_content(i, "Car", result); format(Stock[x][vName], 32, result); systemVariables[dsvehicle]++; } printf("[script] %d ds loaded.", systemVariables[dsvehicle]); cache_delete(result1); return 1; }
×
×
  • 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.