31.03.2019, 23:28
I have a problem with cmd. I want to make my skin change after entering the command /buyskin 1 or /buyskin 2. And when I type /buyskin 3 or /buyskin 270 it pops up a message that I can not choose it skiny.
Code:
new Disguise[][] = { {1}, {2} }; CMD:buyskin(playerid, params[]) { if(IsPlayerInRangeOfPoint(playerid, 0.0, 0.0, 0.0, 0.0)) { new lolgf; if(sscanf(params, "d", lolgf)) { SendClientMessage(playerid, -1, "Usage /buyskin [skin id]"); return 1; } new well = 0; if(lolgf > 0 && lolgf < 300) { for(new skin = 0; skin < 300; skin++) { if(lolgf == Disguise[skin][0]) { well = 1; } } if(well == 1) { PlayerInfo[playerid][skin_id] = lolgf; SetPlayerSkin(playerid, lolgf); SendClientMessage(playerid, -1, "You bought a new skin!"); } else { SendClientMessage(playerid, -1, "You can not choose this skin!"); } } else { SendClientMessage(playerid, -1, "Skin from 1 to 299!"); } } return 1; }