CarOwner
#1

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:
PHP код:
enum carData {
    
carID,
    
carExists,
    
carModel,
    
carOwner,
    
Float:carPos[4],
    
carColor1,
    
carColor2,
    
carPaintjob,
    
carLocked,
    
carMods[14],
    
carImpounded,
    
carImpoundPrice,
    
carFaction,
    
carWeapons[5],
    
carAmmo[5],
    
carVehicle
}; 
CarOwner SQL example(s)
The examples it's biggest, then i uploaded her on pastebin

1ST Example
2ND Example

Command:
PHP код:
CMD:verifyplate(playeridparams[])
{
    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_iHandleMAX_PLAYER_NAME);
    
Dialog_Show(playeridInfoPMESPDIALOG_STYLE_MSGBOX"MDC""Vehicle Model: %s\nYear of Fabrication: %i\nOwner: %s.""Fechar"""ReturnVehicleName(id), FabricationOwner);
    return 
1;

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.
Reply


Messages In This Thread
CarOwner - by MineiriinHo - 03.11.2016, 03:02
Re: CarOwner - by Hansrutger - 03.11.2016, 03:52
Re: CarOwner - by Vince - 03.11.2016, 08:33

Forum Jump:


Users browsing this thread: 1 Guest(s)