ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 1683

Help on players car name.

by Pr0jectN1ne - 01-16-2019 - 07:47 PM
#1
Does anyone know why this if statement is not working as its annoying me now.if its something small to fix it i do apologise.
Code:
char* Carif;
char* CarName;
CarName = _GET_LABEL_TEXT(GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(GET_ENTITY_MODEL(GET_VEHICLE_PED_IS_IN(GET_PLAYER_PED(SelectPlayer), true))));
if (CarName == "Adder")
{
    Carif = "true";
}
else
{
    Carif = "false";
}
Reply
#2
This sammodzhd ?
SPARBYMODZ  |  DEV    
Reply
#3
(01-16-2019 - 08:44 PM)SparbyModz Wrote: This sammodzhd ?

Eyes
Reply
#4
(01-16-2019 - 07:47 PM)Pr0jectN1ne Wrote: Does anyone know why this if statement is not working as its annoying me now.if its something small to fix it i do apologise.
Code:
char* Carif;
char* CarName;
CarName = _GET_LABEL_TEXT(GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(GET_ENTITY_MODEL(GET_VEHICLE_PED_IS_IN(GET_PLAYER_PED(SelectPlayer), true))));
if (CarName == "Adder")
{
    Carif = "true";
}
else
{
    Carif = "false";
}
thats the worst way to do it.
Also bad idea to ask for help with native type stuff, people might think ur a skid.
Also just a clue use sprintf. Like this

char test[1];
char* meme = Ur natives to get the name here.
sprintf(test "Vehicle: %s", Meme);
Reply
#5
(01-16-2019 - 09:33 PM)magiccarpet Wrote:
(01-16-2019 - 07:47 PM)Pr0jectN1ne Wrote: Does anyone know why this if statement is not working as its annoying me now.if its something small to fix it i do apologise.
Code:
char* Carif;
char* CarName;
CarName = _GET_LABEL_TEXT(GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(GET_ENTITY_MODEL(GET_VEHICLE_PED_IS_IN(GET_PLAYER_PED(SelectPlayer), true))));
if (CarName == "Adder")
{
    Carif = "true";
}
else
{
    Carif = "false";
}
thats the worst way to do it.
Also bad idea to ask for help with native type stuff, people might think ur a skid.
Also just a clue use sprintf. Like this

char test[1];
char* meme = Ur natives to get the name here.
sprintf(test "Vehicle: %s", Meme);
yea true but i have the vehicle they using already, im just trying to use this for something else im trying to get working. i know it will be messy but yea  Cheese
Reply
#6
Code:
char* Carif = "false";
int veh = GET_VEHICLE_PED_IS_IN(GET_PLAYER_PED(SelectPlayer), false);
char *CarName = _GET_LABEL_TEXT(GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(GET_ENTITY_MODEL(veh)));
if (!strcmp(CarName, "Adder"))
{
Carif = "true";
}
This account is currently banned
Ban reason: Leeching and Spamming is not allowed, please read the forum Rules upon your return.
Multi
Reply
#7
A string cannot be a method. 
It’s an illegal class.

Use an STL class to prevent overloading memory.
You’ll find that code will use 4x more memory than an STL class.
Reply
#8
(01-16-2019 - 07:47 PM)Pr0jectN1ne Wrote: Does anyone know why this if statement is not working as its annoying me now.if its something small to fix it i do apologise.
Code:
char* Carif;
char* CarName;
CarName = _GET_LABEL_TEXT(GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(GET_ENTITY_MODEL(GET_VEHICLE_PED_IS_IN(GET_PLAYER_PED(SelectPlayer), true))));
if (CarName == "Adder")
{
    Carif = "true";
}
else
{
    Carif = "false";
}

Code:
char vehModel[120];
Vehicle vehicle = IS_PED_SITTING_IN_ANY_VEHICLE(GET_PLAYER_PED(SelectPlayer));
Hash model = GET_ENTITY_MODEL(vehicle);
char* displayName = GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(model);
sprintf(vehModel, "%s", displayName);
DrawText(vehModel);
This account is currently banned
Ban reason: Leeching and Spamming is not allowed, please read the forum Rules upon your return.
Reply

Users browsing: 2 Guest(s)