help with car colour
#6

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
Better do it with ZCMD and SSCANF2

pawn Код:
CMD:cc(playerid, params[])
{
    new ColorID, ColorID2, vehicleid, str[75];
    if(sscanf(params, "dd", ColorID,ColorID2)) return SendClientMessage(playerid, COLOR, "USAGE: /carcolor [1/126] [1/126]");
    else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR, "You are not in a vehicle!");
    else if(ColorID < 0 && ColorID > 126) return SendClientMessage(playerid, COLOR, "CarColor cannot be above 126 or below 0!");
    else if(ColorID2 < 0 && ColorID2 > 126) return SendClientMessage(playerid, COLOR, "CarColor2 cannot be above 126 or below 0!");
    else
    {
        vehicleid = GetPlayerVehicleID(playerid);
        ChangeVehicleColor(vehicleid, ColorID, ColorID2);
        format(str, sizeof(str),">> CarColor 1 changed to %d and CarColor 2 changed to %d  <<",ColorID, ColorID2);
        SendClientMessage(playerid, COLOR, str);
    }
    return 1;
}
I figured a new scripter wouldn't know much of zcmd and sscanf.
Reply


Messages In This Thread
help with car colour - by [EDT]AmanSingh123 - 05.03.2011, 16:29
Re: help with car colour - by austin070 - 05.03.2011, 16:43
Re: help with car colour - by [EDT]AmanSingh123 - 05.03.2011, 16:51
Re: help with car colour - by austin070 - 05.03.2011, 16:53
Re: help with car colour - by alpha500delta - 05.03.2011, 16:56
Re: help with car colour - by austin070 - 05.03.2011, 16:58
Re: help with car colour - by alpha500delta - 05.03.2011, 17:02
Re: help with car colour - by [EDT]AmanSingh123 - 05.03.2011, 17:14
Re: help with car colour - by Oddie - 05.03.2011, 17:32
Re: help with car colour - by [EDT]AmanSingh123 - 05.03.2011, 17:54

Forum Jump:


Users browsing this thread: 2 Guest(s)