05.03.2011, 16:43
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;
}