Jump to content
  • 0

Carcolor


DavidTKD

Question

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;
}

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

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.

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