change skin thing
#1

Hey guys.

Since I can't change my skin anymore with F4 /kill because I have a save skin thing I want a /changeskin cmd.
But alsoI want that people need /permission [playerid] to take these skins:

0 105 106 107 102 103 104 114 115 116 108 109 110 277 278 279 280 281 282 287

If that would be possible the /changeskin would be awesome
Can someone help me with it>
It is important


Regards
Reply
#2

First of all add this function:
Код:
stock IsValidSkin(skinid)
  {
    #define	MAX_BAD_SKINS 57
    new badSkins[MAX_BAD_SKINS] =
    {
      143, 110 // This is example.Put your skins that players cant use without permission.
    };
    if (skinid < 0 || skinid > 299) return false;
    for (new i = 0; i < MAX_BAD_SKINS; i++)
    {
      if (skinid == badSkins[i]) return false;
    }
    #undef MAX_BAD_SKINS
    return 1;
  }
And then make the command:
Код:
    if(strcmp(cmd, "/changeskin", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			new skin;
			tmp = strtok(cmdtext, idx);
			skin = strval(tmp);
			SetPlayerSkin(playerid, skin);
		}
		return 1;
	}
Reply
#3

Quote:
Originally Posted by Chuck_Taylor
First of all add this function:
Код:
stock IsValidSkin(skinid)
  {
    #define	MAX_BAD_SKINS 57
    new badSkins[MAX_BAD_SKINS] =
    {
      143, 110 // This is example.Put your skins that players cant use without permission.
    };
    if (skinid < 0 || skinid > 299) return false;
    for (new i = 0; i < MAX_BAD_SKINS; i++)
    {
      if (skinid == badSkins[i]) return false;
    }
    #undef MAX_BAD_SKINS
    return 1;
  }
And then make the command:
Код:
    if(strcmp(cmd, "/changeskin", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			new skin;
			tmp = strtok(cmdtext, idx);
			skin = strval(tmp);
			SetPlayerSkin(playerid, skin);
		}
		return 1;
	}
Thanks. But I also need to know how to give them permission
Reply
#4

Define something like this:
Код:
HavePermission[MAX_PLAYERS];
It should reset when the player connects, so add this on OnPlayerConnect:
Код:
HavePermission[playerid] = 0;
Add the cmd:
Код:
if(strcmp(cmd, "/changeskin", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(IsValidSkin(skin) || HavePermission[playerid] == 1)
		  	{
			  new skin;
			  tmp = strtok(cmdtext, idx);
			  skin = strval(tmp);
			  SetPlayerSkin(playerid, skin);
			}
		}
		return 1;
	}
And at last u need to make a command that gives the player permission(It should return HavePermission for player to 1)
Reply
#5

Ok thanks.
And BTW. The host link in your signature. How much does it cost when I want this:
50 playerslots 6 months
Reply
#6

its 5$ for 50 slots for 1 month
Reply
#7

Quote:
Originally Posted by Chuck_Taylor
its 5$ for 50 slots for 1 month
Ok thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)