Help with "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: Help with "Unknown Command" (
/showthread.php?tid=661614)
Help with "Unknown Command" -
ddiioonn123 - 09.12.2018
Hi, i am new at SA-MP scripting, and every command i create, when test on server, it's saying: "Unknown Command"/
Any help?
For ex. Spawn Vehicle code:
Pawn CODE:
PHP код:
new Vehicle[MAX_PLAYERS];
COMMAND:kerr(playerid, params[]){
new car;
new string[128];
new first;
new second;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
if(sscanf(params, "i", car, first, second)) return SendClientMessage(playerid, 0xF0F8FFAA, "Perdorimi: /kerr [VEHICLE ID]");
if(car < 400 || car > 611) return SendClientMessage(playerid, 0xF0F8FFAA, "ID i kerrit duhet te jete me e madhe se 399, dhe me e vogel se 612");
if(Vehicle[playerid] != 0){
DestroyVehicle(Vehicle[playerid]);
}
Vehicle[playerid] = CreateVehicle(car, X, Y, Z + 3.0, first, second, 1, -1);
format(string, sizeof(string), "Ti ke krijuar nje kerr, me id", car);
SendClientMessage(playerid, 0xF0F8FFAA, string);
return 1;
}
Re: Help with "Unknown Command" -
scripter112 - 09.12.2018
try this:
Код:
new Vehicle[MAX_PLAYERS];
COMMAND:kerr(playerid, params[]){
new car;
new string[128];
new first;
new second;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
if(sscanf(params, "iii", car, first, second)) return SendClientMessage(playerid, 0xF0F8FFAA, "Perdorimi: /kerr [VEHICLE ID][color1][color2]");
if(car < 400 || car > 611) return SendClientMessage(playerid, 0xF0F8FFAA, "ID i kerrit duhet te jete me e madhe se 399, dhe me e vogel se 612");
if(Vehicle[playerid] != 0){
DestroyVehicle(Vehicle[playerid]);
}
Vehicle[playerid] = CreateVehicle(car, X, Y, Z + 3.0, first, second, 1, -1);
format(string, sizeof(string), "Ti ke krijuar nje kerr, me id", car);
SendClientMessage(playerid, 0xF0F8FFAA, string);
return 1;
}