PaintJob Problem..
#4

Quote:
Originally Posted by dorperez
Посмотреть сообщение
The command is working but it doesnt change the paintjob colors...
It is changes only the paintjob not the color
For color use another command, like with ZCMD
pawn Код:
CMD:carcolor(playerid, params[])
{
    new vehicleid, color1, color2;
    if((vehicleid = GetPlayerVehicleID(playerid)))
    {
        if(sscanf(params, "dd", color1, color2)) return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}Usage: /carcolor [color 1] [color 2]");
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You' re not driver!");
        ChangeVehicleColor(vehicleid, color1, color2);
        return 1;
    }
    else return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You are not in a vehicle!");
}
Or strcmp
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128];
    new idx;
    new tmp[256];
    if(strcmp(cmd, "/carcolor", true) == 0) {
        new color1, color2;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /carcolor [color1] [color2]");
        color1 = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /carcolor [color1] [color2]");
        color2 = strval(tmp);
        ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
        return 1;
    }
    //More of your code
Also, may this is useful if you have errors. I don't remember it
pawn Код:
stock strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' ')) {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply


Messages In This Thread
PaintJob Problem.. - by dorperez - 10.11.2011, 12:29
Re: PaintJob Problem.. - by Kostas' - 10.11.2011, 12:39
Re: PaintJob Problem.. - by dorperez - 10.11.2011, 12:49
Re: PaintJob Problem.. - by Kostas' - 10.11.2011, 12:54
Re: PaintJob Problem.. - by dorperez - 10.11.2011, 13:17
Re: PaintJob Problem.. - by Kostas' - 10.11.2011, 13:36
Re: PaintJob Problem.. - by dorperez - 10.11.2011, 14:01
Re: PaintJob Problem.. - by Kostas' - 10.11.2011, 14:04
Re: PaintJob Problem.. - by dorperez - 10.11.2011, 14:05
Re: PaintJob Problem.. - by Kostas' - 10.11.2011, 14:10

Forum Jump:


Users browsing this thread: 4 Guest(s)