"SERVER: Unknown command." Problem
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The problem is that the function expects a vehicle ID so it can use GetVehicleModel function but you pass a vehicle model ID instead so it returns 0 as modelid. What I used to have in my old gamemode was similar to this:

pawn Код:
GetVehicleFriendlyName(id, bool: modelid = false)
{
    new GVFNstring[56];
    if ((!modelid && (400 <= (id = GetVehicleModel(id)) <= 611)) || (modelid && (400 <= id <= 611))) strcat(GVFNstring, VehicleFriendlyNames[id - 400]);
    return GVFNstring;
}
You can now simply use:
pawn Код:
GetVehicleFriendlyName(vehicleid_here);
// or
GetVehicleFriendlyName(modelid_here, true); // it's important to set to "true"
which in your case is the second.

By the way, you don't need to wrap the name of the vehicles in braces and it'd be advised to use arrays instead of Car1 to Car10.
Tested, atleast the dialog shows now... its showing that its stored, but the vehicle model still isnt showing hmm


Код:
if(c1 == 0)
		{
		    c1name = "Slot 1: Empty";
		}
		else if(c1 > 0)
		{
		    c1name = "Slot 1: %s (Stored)", GetVehicleFriendlyName(c1, true);
		}
I guess this is wrong
Reply


Messages In This Thread
"SERVER: Unknown command." Problem - by SkyFlare - 27.11.2016, 19:35
Re: "SERVER: Unknown command." Problem - by Konstantinos - 27.11.2016, 19:42
Re: "SERVER: Unknown command." Problem - by SkyFlare - 27.11.2016, 19:49
Re: "SERVER: Unknown command." Problem - by Konstantinos - 27.11.2016, 19:52
Re: "SERVER: Unknown command." Problem - by SkyFlare - 27.11.2016, 19:56
Re: "SERVER: Unknown command." Problem - by Konstantinos - 27.11.2016, 20:06
Re: "SERVER: Unknown command." Problem - by SkyFlare - 27.11.2016, 20:16
Re: "SERVER: Unknown command." Problem - by Konstantinos - 27.11.2016, 20:20
Re: "SERVER: Unknown command." Problem - by SkyFlare - 27.11.2016, 20:25

Forum Jump:


Users browsing this thread: 1 Guest(s)