11.09.2012, 15:41
Hello,
I've made a /changeclothes command, there's no errors during compilation but the command itself doesn't work in game, nothing appears when I input for instance /changeclothes 1, only the top bit of the script works. I haven't indented it yet properly, because I'm playing with it constantly.
I've made a /changeclothes command, there's no errors during compilation but the command itself doesn't work in game, nothing appears when I input for instance /changeclothes 1, only the top bit of the script works. I haven't indented it yet properly, because I'm playing with it constantly.
Код:
command(changeclothes, playerid,params[]) { new slot, string[86]; if(sscanf(params, "u", slot)) { SendClientMessage(playerid, COLOR_WHITE, "Server: /changeclothes [slot 1-3]"); } else { if(slot == 1) { if(Player[playerid][Clothes1] != GetPlayerSkin(playerid)) { format(string, sizeof(string), "You have changed into your Slot 1 clothes."); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "* %s changed their clothes quickly. *", MaskSwitch(playerid)); SendLocalMessage(playerid, COLOR_PINK, string); SetPlayerSkin(playerid, Player[playerid][Clothes1]); } else return SendClientMessage(playerid, COLOR_GREY, "You have no clothes in this slot."); } else if(slot == 2) { if(Player[playerid][Clothes2] != GetPlayerSkin(playerid)) { format(string, sizeof(string), "You have changed into your Slot 2 clothes."); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "* %s changed their clothes quickly. *", MaskSwitch(playerid)); SendLocalMessage(playerid, COLOR_PINK, string); SetPlayerSkin(playerid, Player[playerid][Clothes2]); } else return SendClientMessage(playerid, COLOR_GREY, "You have no clothes in this slot."); } else if(slot == 3) { if(Player[playerid][Clothes3] != GetPlayerSkin(playerid)) { format(string, sizeof(string), "You have changed into your Slot 3 clothes."); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "* %s changed their clothes quickly. *", MaskSwitch(playerid)); SendLocalMessage(playerid, COLOR_PINK, string); SetPlayerSkin(playerid, Player[playerid][Clothes3]); } else return SendClientMessage(playerid, COLOR_GREY, "You have no clothes in this slot"); } } return 1; }