Jump to content

[REZOLVAT] Problema VIP Car


alkaTraz
 Share

Recommended Posts

Username: alkaTraz
Problema întălnită: Daca o masina este vip, vreau cand intrii in ea acolo la detalii ex ' is owned by alkatraz | .... |,etc,etc,  [VIP] '
Detalii despre problemă: -
Ce ai încercat să faci înainte să postezi?: Am adaugat, si nu a mers.

if(strlen(CarInfo[vsid][cText]) > 3) format(vip, sizeof(vip), "{FFFF00}[VIP]");


Cod sursă (recomandat pastebin.com) : link pastebin
Alte detalii: folosesc gamemode-ul burned.

Edited by alkaTraz
Link to comment
Share on other sites

Noroc.

Inlocuieste in ambele locuri

asta: SCMEx(playerid, -1, "This %s (ID %d) is owned by %s | Colors: %d, %d | Odometer: %.2f km | Insurance: $%s",aVehicleNames[CarInfo[carid][cModel]-400], CarInfo[carid][Spawned], CarInfo[carid][cOwner], CarInfo[carid][cColorOne], CarInfo[carid][cColorTwo], CarInfo[carid][KM], FormatNumber(CarInfo[carid][cTax]));

cu asta: https://pastebin.com/3hXFZWJX

Edited by Spiciu
Link to comment
Share on other sites

if(CarInfo[carid][Userid] == PlayerInfo[playerid][pSQLID]) {
	KillTimer(VehicleTimer[carid]);
    SCMEx(playerid, -1, "This %s (ID %d) is owned by %s | Colors: %d, %d | Odometer: %.2f km | Insurance: $%s", 
    	aVehicleNames[CarInfo[carid][cModel]-400], CarInfo[carid][Spawned], CarInfo[carid][cOwner], 
    	CarInfo[carid][cColorOne], CarInfo[carid][cColorTwo], CarInfo[carid][KM], FormatNumber(CarInfo[carid][cTax]), (strlen(CarInfo[carid][cText]) > 3) ? (" {FFFF00}VIP") : (""));
    if(CarInfo[carid][cPoints] == 0) {
        SCM(playerid, COLOR_GREY, "Nu ai platit asigurarea! Ca s-o platesti, foloseste comanda /v > Vehicul > Asigurare.");
        new engine,lights,alarm,doors,bonnet,boot,objective;
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); 
        vehEngine[vehicleid] = 0;              
	}          
}
else if(CarInfo[carid][cID] != -2 && carid != 0) {
	KillTimer(VehicleTimer[carid]);
	SCMEx(playerid, -1, "This %s (ID %d) is owned by %s | Colors: %d, %d | Odometer: %.2f km | Insurance: $%s",
		aVehicleNames[CarInfo[carid][cModel]-400], CarInfo[carid][Spawned], CarInfo[carid][cOwner], 
		CarInfo[carid][cColorOne], CarInfo[carid][cColorTwo], CarInfo[carid][KM], FormatNumber(CarInfo[carid][cTax]), (strlen(CarInfo[carid][cText]) > 3) ? (" {FFFF00}VIP") : (""));
	if(CarInfo[carid][cPoints] == 0) {
		SCM(playerid, COLOR_GREY, "Acest vehicul nu are asigurarea platita!");
		new engine,lights,alarm,doors,bonnet,boot,objective;
		GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);     
		vehEngine[vehicleid] = 0;
	}
}

Ai scrise de 2 ori aceleasi chestii, ar fi ok sa rescrii portiunea asta de cod.

Link to comment
Share on other sites

Acum 59 minute, Spiciu a spus:

Noroc.

Inlocuieste in ambele locuri

asta: SCMEx(playerid, -1, "This %s (ID %d) is owned by %s | Colors: %d, %d | Odometer: %.2f km | Insurance: $%s",aVehicleNames[CarInfo[carid][cModel]-400], CarInfo[carid][Spawned], CarInfo[carid][cOwner], CarInfo[carid][cColorOne], CarInfo[carid][cColorTwo], CarInfo[carid][KM], FormatNumber(CarInfo[carid][cTax]));

cu asta: https://pastebin.com/3hXFZWJX

 

imi da loose identation pt ca nu stiu sa asez codul .. ma poti ajuta?

Link to comment
Share on other sites

Acum 5 minute, alkaTraz a spus:

 

imi da loose identation pt ca nu stiu sa asez codul .. ma poti ajuta?

Apesi click inainte de text pe linia pe care vrei sa o asezi si apesi tab de cate ori e nevoie, pana se aliniaza..sau apesi shift+tab ca sa le dai inspre inapoi.

Btw, functioneaza codul? iti apare vip sau nu?
 

Link to comment
Share on other sites

  • L0K3D locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...