HELP ME WITH /buyskin +REP
#1

I'm new to pawno, and i tried 100 COMBINATIOS OF SETSKIN COMMAND non of them work, i need it but i need to put it on isplayerinrangeofpoint and please don't make zcmd ... just regular ... Plss
Here are the coordinates ...
207.4764,-100.9283,1005.2578






IF it works i give +rep !
Thank u !
Reply
#2

Hare Try This :
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buyskin", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, 207.4764,-100.9283,1005.2578)) //Checks If Player In The Place 5.0 is the redius!
        {
           if(GetPlayerMoney(playerid) < 5) return SendClientMessage(playerid, 0xFF0000FF, "You Dont Have Enough Money!"); //if player dont have enough money it doesnt buy and send that message
           SetPlayerSkin(playerid, 0); // 0 is cj if u want other change the id number!
        }
        else
        {
           SendClientMessage(playerid, 0xFF0000FFm "You Are Not In The Point!");//if player no in the place (point) It says that player not in the point!
        }
        return 1;
    }
    return 0;
}
Reply
#3

sorry i did litle mistake
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buyskin", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, 207.4764,-100.9283,1005.2578)) //Checks If Player In The Place 5.0 is the redius!
        {
           if(GetPlayerMoney(playerid) < 5) return SendClientMessage(playerid, 0xFF0000FF, "You Dont Have Enough Money!"); //if player dont have enough money it doesnt buy and send that message
           SetPlayerSkin(playerid, 0); // 0 is cj if u want other change the id number!
        }
        else
        {
           SendClientMessage(playerid, 0xFF0000FF, "You Are Not In The Point!");//if player no in the place (point) It says that player not in the point!
        }
        return 1;
    }
    return 0;
}
Reply
#4

Try this

pawn Код:
stock SCP(_id, _param[], _command[] = "")
{
    format(iStr, sizeof(iStr), "{6a696a}[Command]: /%s {9c9a9c}%s", _command, _param);
    return SendMessageToPlayer(_id, COLOR_LIGHTGREY, iStr, 128);
}
pawn Код:
COMMAND:buyskin(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 207.4764,-100.9283,1005.2578)
    if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_GREY, "Not enough money!");
    {
        new iSkin;
        if(sscanf(params, "d", iSkin)) return SCP(playerid, "[skin id]");
        if(!IsValidSkin(iSkin)) return SCP(playerid, "[skin id]");
        SetPlayerSkin(playerid, iSkin);
        PlayerInfo[playerid][Skin] = iSkin;
        return 1;
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
Hare Try This :
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/buyskin", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, 207.4764,-100.9283,1005.2578)) //Checks If Player In The Place 5.0 is the redius!
        {
           if(GetPlayerMoney(playerid) < 5) return SendClientMessage(playerid, 0xFF0000FF, "You Dont Have Enough Money!"); //if player dont have enough money it doesnt buy and send that message
           SetPlayerSkin(playerid, 0); // 0 is cj if u want other change the id number!
        }
        else
        {
           SendClientMessage(playerid, 0xFF0000FFm "You Are Not In The Point!");//if player no in the place (point) It says that player not in the point!
        }
        return 1;
    }
    return 0;
}
Just a tip, you wouldn't really need all those { }'s. You could just do something like:

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, Float:Radius, Float:X, Float:Y, Float:Z)) return SendClientMessage(playerid, 0xFFFFFFF, "You are not in range of the location.");
(instead of the else SendClientMessage part, just like you did with the money check - in my opinion this makes it more clean)
Reply
#6

Quote:
Originally Posted by C0olp1x
Посмотреть сообщение
and please don't make zcmd ... just regular ... Plss
Okay, so you don't want to have faster, more simpler commands. Fine. That makes no sense but hey, who am I to judge...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)