Minor problem with DCMD set skin command
#1

Code:
dcmd_setskin(playerid, params[])
{
	new str[128], player2, skin;
  if(PlayerInfo[playerid][pAdmin] == 0) return SystemMsg(playerid, "You must be a admin to use this command!");
  if(PlayerInfo[playerid][pAdmin] >= 3)
  if(sscanf(params, "ud", player2, skin)) return SendClientMessage(playerid, COLOR_SYSTEM, "USAGE: /setskin [playerid] [skin id]");
  if(!IsValidSkin(skin)) SendClientMessage(playerid,COLOR_SYSTEM,"Invalid skin id");
  if(PlayerInfo[player2][pLogged] == 0) return SystemMsg(playerid, "That player is not connected!");
  SetPlayerSkin(player2, skin);
  dUserSetINT(PlayerName(player2)).("pSkin",GetPlayerSkin(player2));
  format(str, sizeof(str), "You have just set %s to skin ID %s", PlayerName(player2), skin);
  SendClientMessage(playerid, COLOR_RED, str);
  format(str, sizeof(str), "You have just been set to skin ID %s by %s", skin, PlayerName(playerid));
  SendClientMessage(playerid, COLOR_RED, str);
  format(str, sizeof(str), "ADMIN %s (%s) has given %s (%s) Skin ID %s on %s", PlayerName(playerid), GetIp(playerid), PlayerName(player2), GetIp(player2), skin, TimeDate());
  AdminLog(str);
  return 1;
}


Am I missing something? I just wan't it to show the ID's normally. not Y A B lol?
Reply
#2

It Because the Numeric Strings are %d ... not %s

Change:
pawn Code:
if(PlayerInfo[playerid][pAdmin] == 0) return SystemMsg(playerid, "You must be a admin to use this command!");
into
pawn Code:
if(PlayerInfo[playerid][pAdmin] < 3) return SystemMsg(playerid, "You must be an admin Level 3 to use this command!");
and delete
pawn Code:
if(PlayerInfo[playerid][pAdmin] >= 3)

_________________________________________________

Replace The Old one with this:
pawn Code:
format(str, sizeof(str), "You have just set %s to skin ID %d", PlayerName(player2), skin);
SendClientMessage(playerid, COLOR_RED, str);
Same as Above, Replace it...
pawn Code:
format(str, sizeof(str), "You have just been set to skin ID %d by %s", skin, PlayerName(playerid));
SendClientMessage(playerid, COLOR_RED, str);
Reply
#3

Thank you so much, I was bugging out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)