SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/05/2013, 09:29 AM   #1
Dare Devil.....
Huge Clucker
 
Dare Devil.....'s Avatar
 
Join Date: Jan 2012
Location: Pakistan
Posts: 253
Reputation: 10
Default Skin command help..

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;
}
Dare Devil..... is offline   Reply With Quote
Old 30/05/2013, 09:35 AM   #2
AIped
Gangsta
 
AIped's Avatar
 
Join Date: Feb 2011
Location: Netherlands
Posts: 618
Reputation: 46
Default Re: Skin command help..

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
AIped is offline   Reply With Quote
Old 30/05/2013, 09:54 AM   #3
IceBilizard
Gangsta
 
Join Date: Feb 2012
Posts: 869
Reputation: 47
Default Re: Skin command help..

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;
}
IceBilizard is offline   Reply With Quote
Old 30/05/2013, 11:37 AM   #4
GiamPy.
Huge Clucker
 
GiamPy.'s Avatar
 
Join Date: Apr 2011
Location: Ravenna, Italy
Posts: 220
Reputation: 16
Default Re: Skin command help..

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;
}
GiamPy. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Need] I need /skin [id] command [HELP] REP+1! ProdrifterX Scripting Help 2 03/02/2012 01:10 PM
[Help] /Skin command XoSarahMoX Help Archive 3 20/11/2010 07:27 PM
Skin command help FireFox_ Help Archive 3 23/03/2010 11:41 PM
skin command Martin_Smith Help Archive 4 19/12/2009 07:49 AM
Help with set skin command OcTeT Help Archive 10 18/03/2009 02:30 AM


All times are GMT. The time now is 11:38 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.