Skin command help..
#1

It sets the player skin to CJ instead of ID I dont know why any help?

pawn Code:
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;
}
Reply
#2

im not sure how it works with CMD but with sscanf it should look like this;
pawn Code:
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
Reply
#3

pawn Code:
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;
}
pawn Code:
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;
}
Reply
#4

Try this way:

pawn Code:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)