change skin thing - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: change skin thing (
/showthread.php?tid=125699)
change skin thing -
bartje01 - 05.02.2010
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
Re: change skin thing -
pierhs - 05.02.2010
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;
}
Re: change skin thing -
bartje01 - 05.02.2010
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
Re: change skin thing -
pierhs - 05.02.2010
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)
Re: change skin thing -
bartje01 - 05.02.2010
Ok thanks.
And BTW. The host link in your signature. How much does it cost when I want this:
50 playerslots 6 months
Re: change skin thing -
pierhs - 05.02.2010
its 5$ for 50 slots for 1 month
Re: change skin thing -
bartje01 - 05.02.2010
Quote:
Originally Posted by Chuck_Taylor
its 5$ for 50 slots for 1 month
|
Ok thanks