Attach Textdraw on Inside Vehicle
#1

hey , i dont know what must i do ,
i just wanna script to attach textdraw on inside vehicle using cmd .
like /vehtext [text] , and it will attach on vehicle . but that cmd just for admins level 4 .
anyone can help me ?

sorry for bad english
Reply
#2

Attach3DTextLabelToVehicle
Reply
#3

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

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
}
Reply
#4

i have eror
pawn Код:
C:\Documents and Settings\user\Desktop\test.pwn(4) : fatal error 100: cannot read from file: "sscanf"

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
and this script
pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <sscanf>
new Text3D:Label[MAX_VEHICLES]; //defining the Label for everyone vehicle so we can delete it later if needed

public OnFilterScriptInit()
{
    printf("\n  ----------------------------");
    print(" \n  Texdraw Vehicle FileScript loaded");
    printf("\n  ----------------------------\n");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
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
}
Reply
#5

About the error, download + install sscanf here: https://sampforum.blast.hk/showthread.php?tid=120356
Reply
#6

now i have this eror
pawn Код:
C:\Documents and Settings\user\Desktop\test.pwn(24) : error 017: undefined symbol "vehtext"
C:\Documents and Settings\user\Desktop\test.pwn(26) : error 017: undefined symbol "youradminvariable"
C:\Documents and Settings\user\Desktop\test.pwn(29) : error 017: undefined symbol "params"
C:\Documents and Settings\user\Desktop\test.pwn(34) : error 030: compound statement not closed at the end of file (started at line 24)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#7

You need to get ZCMD include and #include <zcmd> at the top.
And if you don't have a saving system for Admin Level just remove the
pawn Код:
if(youradminvariable < 4) return 0;
line.

Remove
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
Reply
#8

Quote:
Originally Posted by dannyk0ed
Посмотреть сообщение
You need to get ZCMD include and #include <zcmd> at the top.
And if you don't have a saving system for Admin Level just remove the
pawn Код:
if(youradminvariable < 4) return 0;
line.

Remove
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
Thanks Working , ups sorry not inside But i Mean how to create Texdraw in left side vehicle like this


But Just In left side . and with cmd .
Thanks Before
Rep + Given
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)