Have Some question ! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Have Some question ! (
/showthread.php?tid=620207)
Have Some question ! -
TYDS - 27.10.2016
Hello !!
I want to make when admin spawn a vehicles it's it should attach a 3Dtextdraw to that car saying "ADMIN CAR". My Code Spawn CAr
Код:
CMD:aspawncar(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 2) {
new
iVehicle,
iColors[2];
if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1])) {
SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /veh [model ID] [color 1] [color 2]");
}
else if(!(400 <= iVehicle <= 611)) {
SendClientMessageEx(playerid, COLOR_GRAD2, "ID from 400 to 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, "color from 0 - 254.");
}
else for(new iIterator; iIterator < sizeof(CreatedCars); iIterator++) if(iIterator >= 49) {
return SendClientMessageEx(playerid, COLOR_GRAD1, "maxium car spawn is 50.");
}
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);
VehicleFuel[CreatedCars[iIterator]] = 100.0;
Vehicle_ResetData(CreatedCars[iIterator]);
LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(CreatedCars[iIterator], fVW);
PutPlayerInVehicle(playerid, CreatedCars[iIterator], 0);
return SendClientMessageEx(playerid, COLOR_GREY, "spawned car!");
}
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "You Not allow to use this cmd.");
return 1;
}
Re: Have Some question ! -
oMa37 - 27.10.2016
CreateDynamic3DTextLabel.
or;
Create3DTextLabel, Attach3DTextLabelToVehicle.
Re: Have Some question ! -
TYDS - 27.10.2016
what different CreateDynamic3DTextLabel and Create3DTextLabel
Re: Have Some question ! -
oMa37 - 27.10.2016
PHP код:
CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
PHP код:
Create3DTextLabel(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, virtualworld, testLOS);