CMD:setskin(playerid, params[])
{
  new pID, value;
  if(PlayerInfo[playerid][pAdmin] >= 2) return 0;
  else if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [id] [Skin ID]");
  else if(value < 1 || value > 299 ) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Only skins 1-299");
  else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player Is Not Connected");
  else
  {
    new string[128], string1[128], target[MAX_PLAYERS], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "You've set %s skin to %i", target, value);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Your skin has been set to %i by %s:", value, pName);
    SendClientMessage(pID, COLOR_LIGHTBLUE, string1);
    PlayerInfo[pID][pSkin] = value;
    SetPlayerSkin(playerid, value);
  }
  return 1;
}
CMD:setskin(playerid, params[])
{
  new pID, value;
  if(PlayerInfo[playerid][pAdmin] <= 2) return 1; // if the admin is level 2 or LOWER it will return nothing
  if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [id] [Skin ID]");
  if(value < 1 || value > 299 ) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Only skins 1-299");
  if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player Is Not Connected");
  new string[128], string1[128], target[MAX_PLAYERS], pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), "You've set %s skin to %i", target, value);
  SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  format(string, sizeof(string), "Your skin has been set to %i by %s:", value, pName);
  SendClientMessage(pID, COLOR_LIGHTBLUE, string1);
  PlayerInfo[pID][pSkin] = value;
  SetPlayerSkin(playerid, value);
  return 1;
}
else if(value < 1 || value > 299 ) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Only skins 1-299");
pName[MAX_PLAYER_NAME];
pName[MAX_PLAYER_NAME+1];
pawn Код:
pawn Код:
|
Thanks for the help but none of the suggestions have helped at all. There is no message whenever I enter the command, all others commands work just fine.
|
if(PlayerInfo[playerid][pAdmin] >= 2) return 0; |
pawn Код:
|
Then I think your level is not higher than or equal to two
try to replace the 0 with a message and see if you get it |
CMD:setskin(playerid, params[])
{
  new pID, value;
  if(PlayerInfo[playerid][pAdmin] >= 2) return 0;
  else if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [id] [Skin ID]");
  else if(value <= 1 || value >= 299 ) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Only skins 1-299");
  else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player Is Not Connected");
  else
  {
    new string[128], string1[128], target[MAX_PLAYERS], pName[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "You've set %s skin to %i", target, value);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Your skin has been set to %i by %s:", value, pName);
    SendClientMessage(pID, COLOR_LIGHTBLUE, string1);
    PlayerInfo[pID][pSkin] = value;
    SetPlayerSkin(playerid, value);
  }
  return 1;