27.05.2011, 13:22
Where i cant find a /carcolour [id1] [id2]
if(!strcmp(cmd, "/CarColour", true))
{
new tmp[256],tmp2[256],Index; tmp = strtok(cmdtext,Index), tmp2 = strtok(cmdtext,Index);
if(!strlen(tmp)||!(strval(tmp) >= 0 && strval(tmp) <= 126)||
!IsNumeric(tmp)||!IsNumeric(tmp2)) return SendClientMessage(playerid,red,"USAGE: /CarColour <Color 1> (<Color 2>)");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"ERROR: you must be in a vehicle.");
if(!strlen(tmp2)) tmp2 = tmp;
new string[256],name[24]; GetPlayerName(playerid,name,24);
format(string,256,"you have changed your vehicle colours to: [%d %d]",strval(tmp),strval(tmp2));
return ChangeVehicleColor(GetPlayerVehicleID(playerid),strval(tmp),strval(tmp2));
}
#include <dudb>
#pragma unused ret_memcpy
if(strcmp("/carcolor", cmdtext, true, 10)== 0)
{
if(IsPlayerInVehicle(playerid))
{
new idx;
new tmp[256]; tmp = strtok(cmdtext, idx);
new tmp2[256]; tmp2 = strtok(cmdtext, idx);
new color1 = strval(tmp);
new color2 = strval(tmp2);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /carcolor [color1] [color2]");
if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /carcolor [color1] [color2]");
ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
}
else
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in a vehicle to use this command !");
}
return 1;
}
return 0;
#include "../include/gl_common.inc"