(HELP) COLOR SAVE PROBLEM
#1

Hey, if i change color of my owned car and respawn it or reset server or something like that, it doesn't save and there is color what there was before again, please could you help me how to do that will save the colors of ownable vehicles?
Maybe can help this command of color... but i need for Pay'n'Spray too, is it possible?

So please help...THX

pawn Код:
else if(strcmp(x_nr,"color",true) == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)
                {
                    SendClientMessage(playerid, COLOR_GREY,"   You don't have a vehicle to respray.");
                    return 1;
                }
                if(GetPlayerMoney(playerid) < 1000)
                {
                    SendClientMessage(playerid, COLOR_GREY,"   You don't have enough money for vehicle respray.");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
                    return 1;
                }
                new color1;
                color1 = strval(tmp);
                if(color1 < 0 && color1 > 126)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
                    return 1;
                }
                new color2;
                color2 = strval(tmp);
                if(color2 < 0 && color2 > 126)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
                    return 1;
                }

                new vehid;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }
                else { return 1; }

                if(IsPlayerInVehicle(playerid, vehid))
                {
                    CarInfo[vehid][cColorOne] = color1;
                    CarInfo[vehid][cColorTwo] = color2;
                    SafeGivePlayerMoney(playerid, -1000);
                    GameTextForPlayer(playerid, "~w~Bill for a Paint Respray~n~~r~-$1000", 5000, 1);
                    ChangeVehicleColor(vehid, color1, color2);
                    OnPropUpdate();
                    OnPlayerUpdate(playerid);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY,"   You are not in your vehicle.");
                    return 1;
                }
Reply
#2

OK, BUMP, I'm goin' sleep, so if you know, leave a message i will read it tomorow, thx ^^
Reply
#3

Well first of all, your if-statement is wrong:
pawn Код:
if(color1 < 0 && color1 > 126)
The color will never be smaller than 0 AND greater than 126 at the same time. Change that to:
pawn Код:
if(!(0 <= color <= 126))
Reply
#4

I don't need that too much i will delete it, only garage respraying will be...but THX, solved already
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)