27.06.2013, 10:22
I guess you mean 3DTextLabel since textdraws cant be 'attached' to anything.
Here is a basic example with zcmd and sscanf2. You should be able to figure out how to make a delete CMD if you wish
Here is a basic example with zcmd and sscanf2. You should be able to figure out how to make a delete CMD if you wish
pawn Код:
new Text3D:Label[MAX_VEHICLES]; //defining the Label for everyone vehicle so we can delete it later if needed
CMD:vehtext(playerid, params[])
{
if(youradminvariable < 4) return 0;
new text[50];
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You need to be in a vehicle!"); //checking if the player is inside any vehicle
if(sscanf(params, "s[50]", text)) return SendClientMessage(playerid, -1, "Correct usage: /vehtext [text]");
new car = GetPlayerVehicleID(playerid); //getting the player vehicleid and storing it in a variable
Label[car] = Create3DTextLabel(text, 0xFF0000FF, 0, 0, 0, 50.0, 0, 1); //creating the label with the text that you typed
Attach3DTextLabelToVehicle(Label[car], car, 0, 0, 0); //attacking it to the vehicle
}

