Help with command who inversate variables. REP ++
#1

pawn Код:
CMD:inversatecarcolors(playerid, params[])
{
    new saveQuery[600];
    new color1,color2;
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(vehicleid == playerVariables[playerid][pCarID1])
        {
            format(saveQuery, sizeof(saveQuery), "UPDATE playeraccounts SET playerCarColour1 = '%d', playerCarColour2 = '%d' WHERE playerID = '%d'",playerVariables[playerid][pCarColour1][1], playerVariables[playerid][pCarColour1][0], playerVariables[playerid][pInternalID]);
            mysql_tquery(handle,saveQuery);
            ChangeVehicleColor(vehicleid, playerVariables[playerid][pCarColour1][1],playerVariables[playerid][pCarColour1][0]);
        }
    }
    return 1;
}
I make the following command to inversate the car colors.
Ex: On player enter his vehicle shows up a message: Vehicle:Infernus Colors: 122 ,2 . When he types /inversatecarcolors the car colours are chaning correctly but the message at on player enter vehicle isn't changing because i didn't set the ingame variables.
Ingame variables are:
pawn Код:
playerVariables[playerid][pCarColour1][0] -> COLOR 1 of THE CAR
playerVariables[playerid][pCarColour1][1] -> COLOR 2 of THE CAR
As you can see in my format i swapped the colors but to make the text updating i need to update the ingame variables to show correctly the colors and i don't know how because i need to swap them too and i don't have any ideea how.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)