How to make /Skin [ID]????
#1

I tryed this far:
pawn Код:
CMD:skin(playerid, params[])
{
    new id;
    if (sscanf(params, "d", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /Skin [ID]");
    if(id < 0 || id > 299) return SendClientMessage(playerid,RED,"Wrong Skin ID");
    SetPlayerSkin(playerid,id);
    return 1;
}
Reply
#2

did it work?
seems looks like working fine to me.
Reply
#3

Quote:
Originally Posted by Romel
Посмотреть сообщение
did it work?
seems looks like working fine to me.
same here
Reply
#4

pawn Код:
CMD:skin(playerid, params[])
{
    new id;
    if (sscanf(params, "d", id)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /Skin [ID]");
    if(id < 0 || id > 299) return SendClientMessage(playerid,RED,"Wrong Skin ID");
    SetPlayerSkin(playerid,id);
    return 1;
}
Reply
#5

Did you recive any errors after compile ?.

Seems to be fine.
Reply
#6

Im Sorry, It was some kind of bug it fixed itself 0_o

Edit:
One little error: When i do only /skin it sends me Usage:Message but also sets skin to 0(CJ)
Reply
#7

pawn Код:
CMD:skin(playerid, params[])
{
    new id;
    if (sscanf(params, "d", id)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /Skin [ID]");
    if(id < 0 || id > 299) return SendClientMessage(playerid,RED,"Wrong Skin ID");
    else
    {
        SetPlayerSkin(playerid,id);
    }
    return 1;
}
Reply
#8

plz how to do it without cmd i want strcmp because i got 4 error with this
Reply
#9

Quote:
Originally Posted by NuLIO
Посмотреть сообщение
plz how to do it without cmd i want strcmp because i got 4 error with this
pawn Код:
// OnPlayerCommandText
    if(strcmp(cmdtext, "/skin", true, 5) == 0) {
        static const
            Usage[] = "Usage: /Skin [ID]",
            Invalid[] = "Wrong Skin ID"
        ;
        if(cmdtext[5] == EOS)
            return SendClientMessage(playerid, 0xFF0000AA, Usage);
        if(cmdtext[5] == ' ') {
            if(sscanf(cmdtext[6], "d", cmdtext[0]))
                return SendClientMessage(playerid, 0xFF0000AA, Usage);
            if(!(0 <= cmdtext[0] <= 299) || (cmdtext[0] == 74))
                return SendClientMessage(playerid, 0xFF0000AA, Invalid);
            return SetPlayerSkin(playerid, cmdtext[0]);
        }
    }
Reply
#10

oh thnx guys for helping me
Reply
#11

return and else? ;c
Reply
#12

Seems like my topic was helpful for other too
Thanks for Helping me and Others
Reply
#13

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
CMD:skin(playerid, params[])
{
    new id;
    if (sscanf(params, "d", id)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /Skin [ID]");
    if(id < 0 || id > 299) return SendClientMessage(playerid,RED,"Wrong Skin ID");
    else
    {
        SetPlayerSkin(playerid,id);
    }
    return 1;
}
What kind of bullshit is that?
He already has a return after his is statement, so there is no reason for a else statement.

The way he had it seemed to be perfectly fine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)