CMD Issue [vcolor]
#1

pawn Код:
CMD:vvcolor(playerid, params[])
{
    if(PlayerInfo[playerid][pPcarkey] == 9999 && PlayerInfo[playerid][pPcarkey2] == 9999)
    {
        SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray.");
        return 1;
    }
    new c1, c2;
    if (sscanf(params, "uu", c1, c2)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /vcolor [ID] [ID]");
    if(c1 < 0 && c1 > 126)
    {
        SendClientMessage(playerid, COLOR_GREY, "   Wrong color id!");
        return 1;
    }
    if(c2 < 0 && c2 > 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 { return 1; }
    if(IsPlayerInVehicle(playerid, vehid))
    {
        CarInfo[vehid][cColorOne] = c1;
        CarInfo[vehid][cColorTwo] = c2;
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid, x,y,z);
        ChangeVehicleColor(vehid, c1, c2);
        ChangeVehicleColor(vehid, c1, c2);
        OnPropUpdate(4,vehid);
        OnPlayerUpdateEx(playerid);
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY,"   You are not in your vehicle.");
        return 1;
    }
}
Anybody spot the error their? My car color changes to black if i enter /vvcolor 3, we're as it shud just say [vcolor id id]

till you enter the ids you want, then it changes?
Reply
#2

i cant do this but i have a different command in my gm that i can give u
Reply
#3

Quote:
Originally Posted by CBCandyBoy
Посмотреть сообщение
i cant do this but i have a different command in my gm that i can give u
Paste it.
Reply
#4

if (sscanf(params, "uu", c1, c2)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /vcolor [ID] [ID]");

it need to be:

if (sscanf(params, "ii", c1, c2)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /vcolor [ID] [ID]");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)