skin command
#1

i need the base of the /Skin command so you say /skin and it give you skin 272, Thanks
Reply
#2

if(strmp(cmdtext,"/skin"......
SetPlayerSkin(playerid,272);
Reply
#3

Well, if you want the command '/skin' to give you skin 272 everytime, you can do this:
pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/skin", cmdtext, true) == 0)
    return SetPlayerSkin(playerid, 272);

  // All your other commands.

  return 0;
}
If however, you want a command set up like '/skin [skin id]', you could try something like this:
pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/skin", cmdtext, true) == 0)
  {
    if(strlen(cmdtext) < 7)
      return SendClientMessage(playerid, 0x33CCFFAA, "USAGE: /skin [skin id]");
    new skin = strval(cmdtext[6]);
    if(IsInvalidSkin(skin))
      return SendClientMessage(playerid, 0x33CCFFAA, "ERROR: Invalid skin id!");
    SetPlayerSkin(playerid, skin);
    return SendClientMessage(playerid, 0x33CCFFAA, "Your skin id was successfully changed.");
  }

  // All your other commands.

  return 0;
}

IsInvalidSkin(skinid)
{ // Created by Simon
// Checks whether the skinid parsed is crashable or not.

#define MAX_BAD_SKINS  14

new badSkins[MAX_BAD_SKINS] = {
3, 4, 5, 6, 8, 42, 65, 74, 86,
119, 149, 208, 273, 289
};

for (new i = 0; i < MAX_BAD_SKINS; i++) {
  if (skinid == badSkins[i]) return true;
}

return false;
}
That code uses IsInvalidSkin() by Simon. I included it, so you don't have to worry.

If you need to clarify any of the functions used, check out the wiki.

~Cueball~
Reply
#4

ffs, none of em, work, and all i need is command to change to skin 272!! lol
Reply
#5

Thank you Cuecumber, I needed that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)