03.11.2016, 03:02
I have a simple script, where gonna show the owner of a vehicle, by your ID.
Example:
/checkplate 212
"The owner of this car is : My name is Jeff"
The problem, isn't on the command, and yes, on the SQL.
I found something on my database.
Instead show the car owner name, show he's ID on the database.
Example:
CarID | CarOwner | ...
212 4
I want to convert the ID, for the player name. It's possible?
Instead show the ID of the car owner, show he's name.
CarData Enum:
CarOwner SQL example(s)
The examples it's biggest, then i uploaded her on pastebin
1ST Example
2ND Example
Command:
I guess, if I create ownerName on the enum, and create a sql table with this, I can create the command, but i don't know how do this.
Example:
/checkplate 212
"The owner of this car is : My name is Jeff"
The problem, isn't on the command, and yes, on the SQL.
I found something on my database.
Instead show the car owner name, show he's ID on the database.
Example:
CarID | CarOwner | ...
212 4
I want to convert the ID, for the player name. It's possible?
Instead show the ID of the car owner, show he's name.
CarData Enum:
PHP код:
enum carData {
carID,
carExists,
carModel,
carOwner,
Float:carPos[4],
carColor1,
carColor2,
carPaintjob,
carLocked,
carMods[14],
carImpounded,
carImpoundPrice,
carFaction,
carWeapons[5],
carAmmo[5],
carVehicle
};
The examples it's biggest, then i uploaded her on pastebin
1ST Example
2ND Example
Command:
PHP код:
CMD:verifyplate(playerid, params[])
{
new
id = 0,
fabrication = random(2016);
if (GetFactionType(playerid) != FACTION_POLICE)
return SendErrorMessage(playerid, "You need's be a cop.");
if (sscanf(params, "d", id))
return SendSyntaxMessage(playerid, "/verifyplate [vehicleid]");
if (!IsValidVehicle(id) || Car_GetID(id) == -1)
return SendErrorMessage(playerid, "You specified a invalid vehicle ID.");
Owner = cache_get_field_content(id, "carOwner", CarData[id][carOwner], g_iHandle, MAX_PLAYER_NAME);
Dialog_Show(playerid, InfoPMESP, DIALOG_STYLE_MSGBOX, "MDC", "Vehicle Model: %s\nYear of Fabrication: %i\nOwner: %s.", "Fechar", "", ReturnVehicleName(id), Fabrication, Owner);
return 1;
}