Command Bug
#1

So i make it that it shows to the player:

Admin: Admin <name> set your skin to <skinid> (pID)
Admin: You set <pIDName> skin to <skinid>
It needs to say:
Admin: You set Lixyde skin to 1
but says:
Admin: You set "blank" skin to 1


I have this:
(sID) is skinID

Код:
new pID, new name2(MAX_PLAYER_NAME);
GetPlayerName(pID, name2, sizeof(name2));
format(str2, sizeof(str2), "{FF1E00}ADMIN: You gived skin to %s to %i", pID, sID);
I hope you understand me, if not here is the full command:

Код:
CMD:setskin(playerid, params[])
{
     if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_GREY, "Трябва да сте поне 2 левел Админ!");
	 new pID,sID, name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], str[128], str2[128];
	 if(sscanf(params, "ui",pID,sID))return SendClientMessage(playerid, COLOR_GREY,"{FFFFFF}Използвай: {FF1E00}/setskin {FFFFFF}[ID] [SkinID]");
	 if(pID == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_GREY, "The Player is not finded!");
	 if(sID > 299)return SendClientMessage(playerid, COLOR_GREY, "The skin is invalid!");
	 SetPlayerSkin(pID,sID);
	 GetPlayerName(pID, name2, sizeof(name2));
	 GetPlayerName(playerid, name, sizeof(name));
	 format(str, sizeof(str), "{FF1E00}ADMIN: Administrator %s set your skin to %i.", name, sID);
	 SendClientMessage(pID, -1,str);
	 format(str2, sizeof(str2), "{FF1E00}ADMIN: You set skin to %s to %i", pID, sID);
	 SendClientMessage(playerid, -1, str2);
     return 1;
}
(Ignore the bugged text)
Reply
#2

instead of pID type name2 cause that is the string you call to change the pID into his name.

Код HTML:
format(str2, sizeof(str2), "{FF1E00}ADMIN: You gived skin to %s to %i", name2, sID);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)