Jump to content

Question

Posted

Salut. Am si eu aceasta comanda care are cateva probleme si as avea nevoie de putin ajutor cand dau sa schimb culoare imi spun ca nu am o culoare hidd si defapt am sau daca vreau sa schimb din hidd in culoare normal imi zice la fel care ar putea sa fie problema ? 

 

carcolor(playerid, params[], help) {
    new colorid,colorpart, string[256];
    if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "Nu esti in vehiculul tau.");
    if(sscanf(params, "ii",colorpart,colorid)) return SCM(playerid, COLOR_GREY, "{FFFFFF}/carcolor [1/2] <Culoarea>");
    new car = GetPlayerVehicleID(playerid);
    if(PersonalCar(playerid) == -1) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu esti in unul dintre vehiculele tale personale!");
    new idd = PersonalCar(playerid);
    if(CarInfo[idd][Spawned] != car) return SCM(playerid, -1, "Nu esti in vehiculul tau personal.");
    if(colorpart==1) {
        if(CarInfo[idd][cColorOne] > 128) return SCM(playerid, -1, "Nu poti schimba culoarea hidden");
           if(PlayerInfo[playerid][pHiddenColor] <= 128 && colorid > 255) return SCM(playerid, -1, "Nu ai culori hidden");
        if(colorid < 0 || colorid > 255) return SCM(playerid, -1, "ID-ul culorilor este cuprins intre 0 si 255.");
         CarInfo[idd][cColorOne] = colorid;
          GivePlayerCash(playerid, -5000);
          if(colorid > 127) {
               PlayerInfo[playerid][pHiddenColor] -= 1;
               UpdateVar(playerid, "HiddenColor", PlayerInfo[playerid][pHiddenColor]);
        }
        Update(playerid, pCashx);
        ChangeVehicleColor(car, colorid, CarInfo[idd][cColorTwo]);
          SCM(playerid,-1, "Vehicle color changed!");
          GameTextForPlayer(playerid, "~r~-$5000", 5000, 1);
          mysql_format(SQL, string, sizeof(string), "UPDATE cars SET ColorOne = %d WHERE ID=%d", colorid, idd);
        mysql_tquery(SQL, string, "", "");
        return 1;
    }
    if(colorpart==2) {
        if(CarInfo[idd][cColorTwo] > 127) return SCM(playerid, -1, "Nu poti schimba culoarea hidden");
        if(PlayerInfo[playerid][pHiddenColor] <= 0 && colorid > 127) return SCM(playerid, -1, "Nu ai culori hidden");
        if(colorid < 127 || colorid > 255) return SCM(playerid, -1, "ID-ul culorilor este cuprins intre 0 si 255.");
         CarInfo[idd][cColorTwo] = colorid;
          GivePlayerCash(playerid, -5000);
          if(colorid > 127) {
               PlayerInfo[playerid][pHiddenColor] -= 1;
               Update(playerid, pHiddenColorx);
               UpdateVar(playerid, "HiddenColor", PlayerInfo[playerid][pHiddenColor]);
        }
        Update(playerid, pCashx);
        ChangeVehicleColor(car, CarInfo[idd][cColorOne], colorid);
          SCM(playerid,-1, "Vehicle color changed!");
          GameTextForPlayer(playerid, "~r~-$5000", 5000, 1);
          mysql_format(SQL, string, sizeof(string), "UPDATE cars SET ColorTwo = %d WHERE ID=%d", colorid, idd);
        mysql_tquery(SQL, string, "", "");
        return 1;
    }
    return 0;
}

3 answers to this question

Recommended Posts

  • 0
Posted

	 if(PlayerInfo[playerid][pHiddenColor] <= 128 && colorid > 255) return SCM(playerid, -1, "Nu ai culori hidden");
	

inlocuieste cu:

	 if(PlayerInfo[playerid][pHiddenColor] <= 0 && colorid > 255) return SCM(playerid, -1, "Nu ai culori hidden");
	
  • 0
Posted

inlocuieste

if(PlayerInfo[playerid][pHiddenColor] <= 0 && colorid > 255) return SCM(playerid, -1, "Nu ai culori hidden");
	

cu 

if(PlayerInfo[playerid][pHiddenColor] <= 0 && colorid > 127) return SCM(playerid, -1, "Nu ai culori hidden");
	

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.