[FilterScript] Shockerz Skin Changer
#1

This is a FS that includes everyskin, it uses a Input Dialog.



when you enter a number below 0 or above 299 it will tell you to pick a skin from 0 to 299


]cmd:
/ changeskin

]Link:
http://pastebin.com/T255Cmmt
Reply
#2

EDIT: NVM
Reply
#3

Pff, who rages for a simple script?

And btw, some skin ids can crash your server, add IsValidSkin function, search for it!
Reply
#4

simple, but looks better than / skins [id] ...

And is modern, but includes this function: for skins invalid (no cart)

try to include this:

Код:
IsInvalidSkin(skinid)
{
    #define MAX_BAD_SKINS 22
    new InSkin[MAX_BAD_SKINS] = {
    0, 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 == InSkin[i]) return true;}
    return 0;
}
and here's a command that function including (without dialogue)

Код:
if (strcmp(cmd, "/skin", true) == 0 )
	{
		new skin[256];
		skin = strtok(cmdtext, idx);

		if (!strlen(skin))
		{
			SendClientMessage(playerid, COLOR_RED, "Use: /skin [skinid]");
			return 1;
		}
		new newskin = strval(skin);
		if ((newskin < 0) || (newskin > 299) || IsInvalidSkin(newskin)) {
			SendClientMessage(playerid, COLOR_RED, "Server: This skin does not exist!");
			return 1;
		}

		if (GetPlayerMoney(playerid) >= 0)
		{
			SetPlayerSkin(playerid, newskin);
			GivePlayerMoney(playerid,-0);
			format(string, 128, "Server: Skin changed to the id %d, have fun", newskin);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "You can not change skin");
		}
		return 1;
	}
bye



... sorry for my bad English ..
Reply
#5

It's a simple script but good work!
pawn Код:
IsInvalidSkin(skinid)
{
    switch(skinid)
    {
        case 3..6, 8, 42, 65, 74, 86, 119, 149, 208, 273, 289: return 1;
        default: return 0;
    }
    return 0;
}
Reply
#6

Ty all and I don't care how you say I should do it
Reply
#7

We only gave you an advice so people wont type in illegal skin IDs and make their game crash.
Reply
#8

good job
i will use it
Reply
#9

Excellent work
Reply
#10

this script not working without AMX how create
Reply
#11

Quote:
Originally Posted by TarikLord55
View Post
this script not working without AMX how create
If you figure out why I'll give you $50.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)