28.07.2014, 03:07
I have a /veh command that when performed, it works, but the server says that the command doesn't exist.
pawn Код:
//The Command itself
CMD:veh(playerid, params[])
{
if(GetPVarInt(playerid, "LoggedIn") == 0) return SendClientMessage(playerid, -1, "ERROR: You are not logged in.");
if(Player[playerid][AdminLevel] >= 4)
{
new string[128], vehid, color1, color2;
if(sscanf(params, "iii", vehid, color1, color2)) return SendClientMessage(playerid, -1, "Command Usage: /veh [vehicle id] [color1] [color2]");
{
if(vehid >= 400 || vehid <= 611)
{
new Float:pX, Float:pY, Float:pZ, Float:pA;
GetPlayerPos(playerid, pX, pY, pZ);
GetPlayerFacingAngle(playerid, pA);
CreateVehicle(vehid, pX+5, pY+5, pZ, pA, color1, color2, 180);
format(string, sizeof(string), "[AdminCMD] You have just spawned a %s.", GetVehicleName(vehid));
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
else return SendClientMessage(playerid, -1, ADMIN);
return 1;
}
pawn Код:
//What the server does when a command actually doesn't exist
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
new string[128];
format(string, sizeof(string), "{C0C0C0}The command {FF0000}%s {C0C0C0}does not exist, please use /help.", cmdtext);
SendClientMessage(playerid, -1, string);
}
return 1;
}