05.03.2015, 19:22
(
Последний раз редактировалось kevannkw; 05.03.2015 в 20:06.
)
so what i am trying is that when an admin spawn a admin car through /acar and they pick a car and color, it should attach a 3Dtextdraw to that car saying "ADMIN SPAWNED CAR". I've done this so far, but it still does not work...
Код:
CMD:acar(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 3) {
new
iVehicle,
iColors[2],
Text3D:vehicle3Dtext[MAX_VEHICLES];
if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1])) {
SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /veh [model ID] [color 1] [color 2]");
}
else if(!(400 <= iVehicle <= 611)) {
SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid model specified (model IDs start at 400, and end at 611).");
}
else if(IsATrain(iVehicle)) {
SendClientMessageEx(playerid, COLOR_GREY, "Trains cannot be spawned during runtime.");
}
else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid color specified (IDs start at 0, and end at 255).");
}
else for(new iIterator; iIterator < sizeof(CreatedCars); iIterator++) if(iIterator >= 49) {
return SendClientMessageEx(playerid, COLOR_GRAD1, "The maximum limit of 50 spawned vehicles has been reached.");
}
else if(CreatedCars[iIterator] == INVALID_VEHICLE_ID) {
new
Float: fVehPos[4];
new fVW = GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
GetPlayerFacingAngle(playerid, fVehPos[3]);
CreatedCars[iIterator] = CreateVehicle(iVehicle, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
vehicle3Dtext[CreatedCars] = Create3DTextLabel( "ADMIN SPAWNED CAR", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
Attach3DTextLabelToVehicle( vehicle3Dtext[ CreatedCars ] , CreatedCars, 0.0, 0.0, 2.0);
VehicleFuel[CreatedCars[iIterator]] = 100.0;
Vehicle_ResetData(CreatedCars[iIterator]);
LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(CreatedCars[iIterator], fVW);
return SendClientMessageEx(playerid, COLOR_GREY, "Vehicle spawned!");
}
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
return 1;
}

