A command says its unknown
#1

pawn Код:
if(strcmp(cmd, "/vList", true) == 0 || strcmp(cmd, "/carlist", true) == 0) -- Does not work - "Unknown cmd"
{
new car[256], string[256];
format(string, 256, "Users/%s.txt", plname);
if(dini_Int(string, "CarsOwned") == 0) return SendClientMessage(playerid, -1, ""#COLOR_GREY"You do not own any car.");
if(dini_Int(string, "Car1") > 0)
{
format(car, 256, "Vehicles/Car%d.txt", dini_Int(string, "Car1"));
if(!dini_Exists(car)) return SendClientMessage(playerid, -1, ""#COLOR_GREY"Error occoured (error #04)");
new msg[256];
format(msg, 256, ""#COLOR_MAGENTA"[CARINFO]Model: "#COLOR_RED"%s(%d)||"#COLOR_MAGENTA"Spawned:%d||Anyone in: %d||Price: %d", GetVehicleNameFromID(dini_Int(car, "Model")), dini_Int(car, "Model"), dini_Int(car, "Spawned"), AnyOneIn[dini_Int(string, "Car1")], dini_Int(car, "Price"));
SendClientMessage(playerid, -1, msg);
}
if(dini_Int(string, "Car2") > 0)
{
format(car, 256, "Vehicles/Car%d.txt", dini_Int(string, "Car2"));
if(!dini_Exists(car)) return SendClientMessage(playerid, -1, ""#COLOR_GREY"Error occoured (error #04)");
new msg[256];
format(msg, 256, ""#COLOR_MAGENTA"[CARINFO]Model: "#COLOR_RED"%s(%d)||"#COLOR_MAGENTA"Spawned:%d||Anyone in: %d||Price: %d", GetVehicleNameFromID(dini_Int(car, "Model")), dini_Int(car, "Model"), dini_Int(car, "Spawned"), AnyOneIn[dini_Int(string, "Car2")], dini_Int(car, "Price"));
SendClientMessage(playerid, -1, msg);
}
if(dini_Int(string, "Car3") > 0)
{
format(car, 256, "Vehicles/Car%d.txt", dini_Int(string, "Car3"));
if(!dini_Exists(car)) return SendClientMessage(playerid, -1, ""#COLOR_GREY"Error occoured (error #04)");
new msg[256];
format(msg, 256, ""#COLOR_MAGENTA"[CARINFO]Model: "#COLOR_RED"%s(%d)||"#COLOR_MAGENTA"Spawned:%d||Anyone in: %d||Price: %d", GetVehicleNameFromID(dini_Int(car, "Model")), dini_Int(car, "Model"), dini_Int(car, "Spawned"), AnyOneIn[dini_Int(string, "Car3")], dini_Int(car, "Price"));
SendClientMessage(playerid, -1, msg);
}
SendClientMessage(playerid, -1, "(Spawned is set to 0?Veh is spawned/Anyone in is set to 1?Someone is in the car)");
return 1;
}
This command says Unknown command. Tell me if I need to bring the previous command on the gamemode.
Reply
#2

Change [ pwn ] to [ pawn ]
Reply
#3

Done.. Btw it does tell you if you dont have own any car.. But if you do have a car, it says Unknown Command.
Reply
#4

Bump!
Reply
#5

I think you have to add something here:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}
Reply
#6

It is added, but anyways it was bugging the text results, not saying Unknown command
Reply
#7

I had the same problem yesterday!
https://sampforum.blast.hk/showthread.php?tid=272922

Check out everything there!
Reply
#8

Didnt help me what to dood?
Reply
#9

Bump.
Reply
#10

What is exactly ur problem? SERVER:UNKNOWN COMMAND, right?

Well, the mistake IS in the thread I posted, u didn't check out everything!

If u don't want to read, well...Try to make the commands extra! One command for /vlist, other one for etc...

EDIT: Try this, untested:


pawn Код:
if(strcmp(cmd, "/vList", true) == 6 || strcmp(cmd, "/carlist", true) == 8)
{
new car[256], string[256];
format(string, 256, "Users/%s.txt", plname);
if(dini_Int(string, "CarsOwned") == 0) return SendClientMessage(playerid, -1, ""#COLOR_GREY"You do not own any car.");
if(dini_Int(string, "Car1") > 0)
{
format(car, 256, "Vehicles/Car%d.txt", dini_Int(string, "Car1"));
if(!dini_Exists(car)) return SendClientMessage(playerid, -1, ""#COLOR_GREY"Error occoured (error #04)");
new msg[256];
format(msg, 256, ""#COLOR_MAGENTA"[CARINFO]Model: "#COLOR_RED"%s(%d)||"#COLOR_MAGENTA"Spawned:%d||Anyone in: %d||Price: %d", GetVehicleNameFromID(dini_Int(car, "Model")), dini_Int(car, "Model"), dini_Int(car, "Spawned"), AnyOneIn[dini_Int(string, "Car1")], dini_Int(car, "Price"));
SendClientMessage(playerid, -1, msg);
}
if(dini_Int(string, "Car2") > 0)
{
format(car, 256, "Vehicles/Car%d.txt", dini_Int(string, "Car2"));
if(!dini_Exists(car)) return SendClientMessage(playerid, -1, ""#COLOR_GREY"Error occoured (error #04)");
new msg[256];
format(msg, 256, ""#COLOR_MAGENTA"[CARINFO]Model: "#COLOR_RED"%s(%d)||"#COLOR_MAGENTA"Spawned:%d||Anyone in: %d||Price: %d", GetVehicleNameFromID(dini_Int(car, "Model")), dini_Int(car, "Model"), dini_Int(car, "Spawned"), AnyOneIn[dini_Int(string, "Car2")], dini_Int(car, "Price"));
SendClientMessage(playerid, -1, msg);
}
if(dini_Int(string, "Car3") > 0)
{
format(car, 256, "Vehicles/Car%d.txt", dini_Int(string, "Car3"));
if(!dini_Exists(car)) return SendClientMessage(playerid, -1, ""#COLOR_GREY"Error occoured (error #04)");
new msg[256];
format(msg, 256, ""#COLOR_MAGENTA"[CARINFO]Model: "#COLOR_RED"%s(%d)||"#COLOR_MAGENTA"Spawned:%d||Anyone in: %d||Price: %d", GetVehicleNameFromID(dini_Int(car, "Model")), dini_Int(car, "Model"), dini_Int(car, "Spawned"), AnyOneIn[dini_Int(string, "Car3")], dini_Int(car, "Price"));
SendClientMessage(playerid, -1, msg);
}
SendClientMessage(playerid, -1, "(Spawned is set to 0?Veh is spawned/Anyone in is set to 1?Someone is in the car)");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)