VehicleName - Problem
#1

i need help,i posted this,i want in log to be vehicle name,not vehicle id.

PHP код:
if(strcmp(x_nr,"sell",true) == 0)
{
    if(
IsAtDealership(playerid))
    {
        if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
        {
            
GetPlayerName(playeridsendernamesizeof(sendername));
            new 
ownvehkey;
            if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey PlayerInfo[playerid][pPcarkey]; }
            else if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey PlayerInfo[playerid][pPcarkey2]; }
            else if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey PlayerInfo[playerid][pPcarkey3]; }
            else { return 
1; }
            if(
strcmp(sendernameCarInfo[ownvehkey][cOwner], true) == 0)
            {
                new 
carsellprice CarInfo[ownvehkey][cValue] / 3;
                new 
Float:x,Float:y,Float:z;
                new 
Float:a;
                
CarInfo[ownvehkey][cOwned] = 0;
                
strmid(CarInfo[ownvehkey][cOwner], "Dealership"0strlen("Dealership"), 999);
                
GivePlayerCash(playerid,carsellprice);
                
PlayerPlaySound(playerid10520.00.00.0);
                
format(stringsizeof(string), "~w~You have sold your car for: ~n~~g~$%d"carsellprice);
                
GameTextForPlayer(playeridstring100003);
                
GetVehiclePos(ownvehkeyxyz);
                
GetVehicleZAngle(ownvehkeya);
                
CarInfo[ownvehkey][cLocationx] = xCarInfo[ownvehkey][cLocationy] = yCarInfo[ownvehkey][cLocationz] = zCarInfo[ownvehkey][cAngle] = a;
                
CarInfo[ownvehkey][mod1] = 0CarInfo[ownvehkey][mod2] = 0CarInfo[ownvehkey][mod3] = 0CarInfo[ownvehkey][mod4] = 0;
                
CarInfo[ownvehkey][mod5] = 0CarInfo[ownvehkey][mod6] = 0CarInfo[ownvehkey][mod7] = 0CarInfo[ownvehkey][mod8] = 0;
                
CarInfo[ownvehkey][mod9] = 0CarInfo[ownvehkey][mod10] = 0CarInfo[ownvehkey][mod11] = 0CarInfo[ownvehkey][mod12] = 0;
                
CarInfo[ownvehkey][mod13] = 0CarInfo[ownvehkey][mod14] = 0CarInfo[ownvehkey][mod15] = 0CarInfo[ownvehkey][mod16] = 0;
                
CarInfo[ownvehkey][mod17] = 0CarInfo[ownvehkey][paintjob] = -1;
                if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { PlayerInfo[playerid][pPcarkey] = -1; }
                else if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { PlayerInfo[playerid][pPcarkey2] = -1; }
                else if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { PlayerInfo[playerid][pPcarkey3] = -1; }
                
RemovePlayerFromVehicle(playerid);
                
TogglePlayerControllable(playerid1);
                
format(CarInfo[vehid][cLicense], 32 ,"Dealership");
                
SetVehicleNumberPlate(vehid,CarInfo[vehid][cLicense]);
                
OnPropUpdate(); SavePlayerData(playerid);
                
DestroyVehicle(ownvehkey);
                new 
thiscar CreateVehicle(CarInfo[ownvehkey][cModel],CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]+1.0,CarInfo[ownvehkey][cAngle],CarInfo[ownvehkey][cColorOne],CarInfo[ownvehkey][cColorTwo],-1);
                
LoadComponents(thiscar);
                new 
tmd;
                new 
h,mi,s;
                
getdate(t,m,d);
                
gettime(h,mi,s);
                
format(stringsizeof(string), "[%d/%d/%d](%d:%d:%d) %s a vandut masina [%d] inapoi la dealer.",d,m,t,h,mi,s,sendername,ownvehkey);
                
MasiniLog(string);
                return 
1;
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"  You have to sit at your own car to sell it! ");
            return 
1;
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GREY"You are not at a dealership");
        return 
1;
    }

here:

PHP код:
format(stringsizeof(string), "[%d/%d/%d](%d:%d:%d) %s a vandut masina [%d] inapoi la dealer.",d,m,t,h,mi,s,sendername,ownvehkey); == Vehicle name,no vehicle id
Reply


Messages In This Thread
VehicleName - Problem - by Akcent_Voltaj - 16.03.2013, 21:03
Re: VehicleName - Problem - by Akcent_Voltaj - 16.03.2013, 21:27

Forum Jump:


Users browsing this thread: 2 Guest(s)