help with car colour
#2

pawn Код:
if(strcmp(cmd, "/cc", true)== 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;

            new vid = GetPlayerVehicleID(playerid);
            if(strval(result) && strval(result[2]) >126 || strval(result) && strval(result[2]) <0) return SendClientMessage(playerid, COLOR_RED, "Invalid color id!");
            ChangeVehicleColor(vid, strval(result), strval(result[2]));
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle!");
        }
        return 1;
    }
I didn't test this, so tell me if there are any errors.
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: 3 Guest(s)