Minor problem with DCMD set skin 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Minor problem with DCMD set skin command (
/showthread.php?tid=121234)
Minor problem with DCMD set skin command -
MisterTickle - 16.01.2010
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?
Re: Minor problem with DCMD set skin command -
CuervO - 16.01.2010
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);
Re: Minor problem with DCMD set skin command -
MisterTickle - 16.01.2010
Thank you so much, I was bugging out.