PDA

View Full Version : Skin command help..


Dare Devil.....
30/05/2013, 09:29 AM
It sets the player skin to CJ instead of ID I dont know why any help?


new skinid;
CMD:clothes(playerid)


{
if(IsPlayerInRangeOfPoint(playerid,10,217.3056,-97.9876,1005.2578))
{
SendClientMessage(playerid, COLOR_WHITE, "You Have bought new clothes.");
GivePlayerMoney(playerid,-100);
SetPlayerSkin(playerid, skinid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /Clothes [SkinID]!");
}
return 1;
}

AIped
30/05/2013, 09:35 AM
im not sure how it works with CMD but with sscanf it should look like this;

dcmd_skin(playerid, params[])
{
new Setto;
if(sscanf(params, "ii",Setto))
{
SetPlayerSkin(playerid, Setto);
new SStr[125];
format(SStr, sizeof(SStr), "Your skin was set to %f.", Setto);
SendClientMessage(playerid,COLOR_ORANGE,SStr);
}
return 1;
}

Maybe you see what you are doing wrong by seeing this

IceBilizard
30/05/2013, 09:54 AM
CMD:buyskin(playerid, params[])
{
new skin;
if(!IsAtClothesShop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "[ERROR]You must in clothes shop to buy the skin");
if(sscanf(params,"i",skin)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /buyskin [SkinID]");
SendClientMessage(playerid, COLOR_YELLOW, "You have successfully bought your own skin.");
GameTextForPlayer(playerid, "~r~$-500", 1000,1);
GivePlayerMoney(playerid, -500);
SetPlayerSkin(playerid,skin);
return 1;
}



forward IsAtClothesShop(playerid);
public IsAtClothesShop(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,20,161.5236, -83.3203, 1001.8047)||
IsPlayerInRangeOfPoint(playerid,20,207.7182,-100.9436,1005.2578) ||
IsPlayerInRangeOfPoint(playerid,20,203.9261,-43.2656,1001.8047) ||
IsPlayerInRangeOfPoint(playerid,20,206.3746,-8.1824,1001.2109) ||
IsPlayerInRangeOfPoint(playerid,20,207.0685,-129.1833,1003.5078))
{ return true; }
return false;
}

GiamPy.
30/05/2013, 11:37 AM
Try this way:

CMD:clothes(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid,10,217.3056,-97.9876,1005.2578))
{
SendClientMessage(playerid, COLOR_WHITE, "You Have bought new clothes.");
GivePlayerMoney(playerid,-100);
SetPlayerSkin(playerid, strval(params));
}
else
return SendClientMessage(playerid, COLOR_RED, "USAGE: /Clothes [SkinID]!");
return 1;
}