SA-MP Forums Archive
ZCMD: Unknown command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ZCMD: Unknown command (/showthread.php?tid=587565)



ZCMD: Unknown command - AMouldyLemon - 31.08.2015

/test is meant to tell me whether or not the vehicle I am sat in is a cop car or not. When performed inside of an FBI Rancher it returns "SERVER: Unknown Command
pawn Код:
CMD:test(playerid, params[])
{
    new veh = GetPlayerVehicleID(playerid);
    if(IsACopCar(veh))
    {
        SendClientMessage(playerid, -1, "Car is a cop car.");
        return true;
    }
    return false;
}
pawn Код:
public IsACopCar(vehicleid)
{
    new vm = GetVehicleModel(vehicleid);
    {
        if(VehicleList[vm - 400][VehType] == VEHICLE_TYPE_GOV) return true;
    }
    return false;
}
pawn Код:
enum VehicleListEnum {
    VehModel,
    VehName[50],
    VehType,
    VehWindows,
    VehTrunk,
    VehDoors,
    VehPrice
};

new VehicleList[][VehicleListEnum] = {
{490, "FBI Rancher", VEHICLE_TYPE_GOV, 4, 1, 4, 000000},
};
// For example.



Re: ZCMD: Unknown command - CrazyChoco - 31.08.2015

Код HTML:
CMD:test(playerid, params[])
{
	new veh = GetPlayerVehicleID(playerid);
	if(IsACopCar(veh))
	{
		SendClientMessage(playerid, -1, "Car is a cop car.");
		return true;
	}
	return true;
}



Re: ZCMD: Unknown command - AMouldyLemon - 31.08.2015

Now it doesn't do anything.


Re: ZCMD: Unknown command - Onfroi - 31.08.2015

return SendClientMessage(playerid, -1, "Car is a cop car.");

remove the return true;


Re: ZCMD: Unknown command - AMouldyLemon - 31.08.2015

Tried that.


Re: ZCMD: Unknown command - Abagail - 31.08.2015

Obviously if you return false it will send the message. ZCMD has been coded so that you can return 0 for the command to act unsuccessful.

You need to check your IsACopCar function; it's obviously returning false when your in an FBI rancher.


Re: ZCMD: Unknown command - YoussefHammad - 31.08.2015

erm........ try that , im not sure if it'll work tho
Код:
stock IsACopCar(vehicleid)
{ 
                new veh = GetPlayerVehicleID(playerid);
		VehicleList[vm - 400][VehType] == VEHICLE_TYPE_GOV;
}
if it doesnt work dont pay attention to it xD
i edited the code again


Re: ZCMD: Unknown command - AMouldyLemon - 31.08.2015

pawn Код:
public IsACopCar(vehicleid)
{
    new vm = GetVehicleModel(vehicleid);
    {
        if(VehicleList[vm - 400][VehType] == VEHICLE_TYPE_GOV) return true;
    }
    return 1;
}
returns every car as a cop car.


Re: ZCMD: Unknown command - Jefff - 31.08.2015

pawn Код:
public IsACopCar(vehicleid)
{
    new vm = GetVehicleModel(vehicleid);
    if(vm == 0) return false;
    return (VehicleList[vm - 400][VehType] == VEHICLE_TYPE_GOV);
}



Re: ZCMD: Unknown command - AMouldyLemon - 31.08.2015

Nope.