25.06.2014, 18:43
how to make /v <name> color like that it can be used by players please help me
if(strcmp(cmd, "/veh", true, 10) == 0)
{
new String[200];
new tmp[256];
new Float:x, Float:y, Float:z;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You didn't give a vehicle name");
new vehicle = GetVehicleModelIDFromName(tmp);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "That vehicle name was not found");
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid) == 1)
{
GetXYInFrontOfPlayer(playerid, x, y, 8);
}
else
{
GetXYInFrontOfPlayer(playerid, x, y, 5);
}
new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
SendClientMessage(playerid, l_green, String);
return 1;
}
COMMAND:car(playerid, params[]) { new carid, carcolor1, carcolor2; if(!sscanf(params, "iii", carid, carcolor1, carcolor2)) { if (carid == 432) return SendClientMessage(playerid, red, "Error: You Can not spawn a rhino / tank."); if (carid == 520) return SendClientMessage(playerid, red, "Error: You can not spawn a hydra."); if(carid >= 400 && carid <= 611) { if(carcolor1 >= 0 && carcolor1 <= 252) { if(carcolor2 >= 0 && carcolor2 <= 252) { new Float:XZ, Float:YZ, Float:ZZ; GetPlayerPos(playerid, XZ, YZ, ZZ); SetVehicleVirtualWorld( CreateVehicle(carid, XZ+4, YZ, ZZ, 10, carcolor1, carcolor2, 0), GetPlayerVirtualWorld(playerid)); SendClientMessage(playerid, 0xD8D8D8FF, "Vehicle Spawned"); return 1; } else return SendClientMessage(playerid, 0xD8D8D8FF, "Only color id's between 0 and 252 are avaliable."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Only color id's between 0 and 252 are avaliable."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "Only id's between 400 and 611 are avaliable."); } else return SendClientMessage(playerid, 0xD8D8D8FF, "USAGE: /car [VehicleId] [Color 1][Color 2]"); }