[FilterScript] Skin Select by name!
#1

Hi! I made a simple FilterScript for selecting a skin, i don't know if a search take much memory because of the 300 string check, but its very useful. You may change the whole script if you want and i don't need to be in an about or something, i dont care.

Код:
// Skin choose menu by Casss!
#include <a_samp>

new ListItemSkin[MAX_PLAYERS][256];
new SkinNames[][64]=
{
		"Carl CJ Johnson",
	"The Truth",
	"Maccer",
	"INVALID_SKIN_ID",
	"INVALID_SKIN_ID",
	"INVALID_SKIN_ID",
	"INVALID_SKIN_ID",
	"Taxi Driver/Train Driver",
	"INVALID_SKIN_ID",
	"Normal Ped",
	"Normal Ped",
	"Casino Worker",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"RS Haul Owner",
	"Airport Ground Worker",
	"Normal Ped",
	"Beach Visitor",
	"Normal Ped",
	"Madd Dogg's Manager",
	"Normal Ped",
	"Normal Ped",
	"BMXer",
	"Madd Dogg Bodyguard",
	"Madd Dogg Bodyguard",
	"Mountain Climber",
	"Builder",
	"Drug Dealer",
	"Drug Dealer",
	"Drug Dealer",
	"Farm-Town inhabitant",
	"Farm-Town inhabitant",
	"Farm-Town inhabitant",
	"Farm-Town inhabitant",
	"Normal Ped",
	"Golfer",
	"Golfer",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"INVALID_SKIN_ID",
	"Normal Ped",
	"Normal Ped",
	"Beach Visitor",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Snakehead (Da Nang)",
	"Mechanic",
	"Mountain Biker",
	"Mountain Biker",
	"INVALID_SKIN_ID",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Feds",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Pilot",
	"Colonel Fuhrberger",
	"Prostitute",
	"Prostitute",
	"INVALID_SKIN_ID",
	"Pool Player",
	"Pool Player",
	"Priest",
	"Normal Ped",
	"Scientist",
	"Security Guard",
	"Normal Ped",
	"Jethro",
	"INVALID_SKIN_ID",
	"Prostitute",
	"Normal Ped",
	"Homeless",
	"Homeless",
	"Homeless",
	"Boxer",
	"Boxer",
	"Elvis Wannabe",
	"Elvis Wannabe",
	"Elvis Wannabe",
	"Prostitute",
	"INVALID_SKIN_ID",
	"Whore",
	"Normal Ped",
	"Normal Ped",
	"Whore",
	"INVALID_SKIN_ID",
	"Beach Visitor",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Jogger",
	"Beach Visitor",
	"Normal Ped",
	"Skeelering",
	"Biker",
	"Normal Ped",
	"Balla",
	"Balla",
	"Balla",
	"Grove Street Families",
	"Grove Street Families",
	"Grove Street Families",
	"Los Santos Vagos",
	"Los Santos Vagos",
	"Los Santos Vagos",
	"The Russian Mafia",
	"The Russian Mafia",
	"The Russian Mafia",
	"Varios Los Aztecas",
	"Varios Los Aztecas",
	"Varios Los Aztecas",
	"Traid",
	"Traid",
	"INVALID_SKIN_ID",
	"Traid",
	"Da Nang Boy",
	"Da Nang Boy",
	"Da Nang Boy",
	"The Mafia",
	"The Mafia",
	"The Mafia",
	"The Mafia",
	"Farm Inhabitant",
	"Farm Inhabitant",
	"Farm Inhabitant",
	"Farm Inhabitant",
	"Farm Inhabitant",
	"Farm Inhabitant",
	"Homeless",
	"Homeless",
	"Normal Ped",
	"Homeless",
	"Beach Visitor",
	"Beach Visitor",
	"Beach Visitor",
	"Office Worker",
	"Taxi Driver",
	"Normal Ped",
	"Normal Ped",
	"Beach Visitor",
	"Beach Visitor",
	"Director",
	"Secretary",
	"INVALID_SKIN_ID",
	"Secretary",
	"Normal Ped",
	"Prostitute",
	"Coffee mam'",
	"Beach Visitor",
	"Well Stacked Pizza",
	"Normal Ped",
	"Farmer",
	"Farmer",
	"Farmer",
	"Farmer",
	"Farmer",
	"Farmer",
	"Bouncer",
	"Bouncer",
	"MIB Agent",
	"MIB Agent",
	"Cluckin' Bell",
	"Food Vendor",
	"Normal Ped",
	"Normal Ped",
	"Casino Worker",
	"Hotel Services",
	"San Fierro Rifa",
	"San Fierro Rifa",
	"San Fierro Rifa",
	"Tatoo Shop",
	"Tatoo Shop",
	"Whore",
	"Ammu-Nation Salesmen",
	"Normal Ped",
	"Punker",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Buisnessman",
	"Normal Ped",
	"Valet",
	"Barbara Schternvart",
	"Helena Wankstein",
	"Michelle Cannes",
	"Katie Zhan",
	"Millie Perkins",
	"Denise Robinson",
	"Farm-Town inhabitant",
	"Farm-Town inhabitant",
	"Farm-Town inhabitant",
	"Farm-Town inhabitant",
	"Farmer",
	"Farmer",
	"Farmer",
	"Karate Teacher",
	"Karate Teacher",
	"Burger Shot Cashier",
	"Normal Ped",
	"Prostitute",
	"Well Stacked Pizza",
	"Normal Ped",
	"INVALID_SKIN_ID",
	"Shop Staff",
	"Homeless",
	"Weird old man",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Shop Staff",
	"Normal Ped",
	"Secretary",
	"Taxi Driver",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Sofori",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Homeless",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Normal Ped",
	"Prostitute",
	"Prostitute",
	"Homeless",
	"The D.A",
	"Afro-American",
	"Mexican",
	"Prostitute",
	"Whore",
	"Prostitute",
	"Whore",
	"Biker",
	"Biker",
	"Pimp",
	"Normal Ped",
	"Beach Visitor",
	"Naked Valet",
	"Bus Driver",
	"Drug Dealer",
	"Limo Driver",
	"Whore",
	"Whore",
	"Golfer",
	"Golfer",
	"Construction Site",
	"Normal Ped",
	"Taxi Driver",
	"Normal Ped",
	"Clown",
	"Tenpenny",
	"Pulaski",
	"Officer Frank Tenpenny (Crooked Cop)",
	"Dwaine",
	"Melvin Big Smoke Harris",
	"Sweet ",
	"Lance Ryder Wilson",
	"Mafia Boss",
	"INVALID_SKIN_ID",
	"Paramedic",
	"Paramedic",
	"Paramedic",
	"Firefighter",
	"Firefighter",
	"Firefighter",
	"Los Santos Police",
	"San Fierro Police",
	"Las Venturas Police",
	"Country Sheriff",
	"San Andreas Police Dept.",
	"S.W.A.T Special Forces",
	"Federal Agents",
	"San Andreas Army",
	"Desert Sheriff",
	"INVALID_SKIN_ID",
	"Ken Rosenberg",
	"Desert Sheriff",
	"Cesar Vialpando",
	"Jeffrey OG Loc Cross",
	"Wu Zi Mu (Woozie)",
	"Michael Toreno",
	"Jizzy B.",
	"Madd Dogg",
	"Catalina",
	"Claude"
};


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/skinmenu", cmdtext, true, 10) == 0)
	{
	    ShowPlayerDialog(playerid,501,DIALOG_STYLE_LIST,"Skin Menu by Casss","New Search...\nSelect by ID...","Choose","Close");
		return 1;
	}
	return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 501 && response == 1)
	{
	    if(listitem == 0)
	    {
	        //searchmenu
	        ShowPlayerDialog(playerid,502,DIALOG_STYLE_INPUT,"Search","Enter search keyword(s):","Continue","Cancel");
	    }
	    else if(listitem == 1)
	    {
	        ShowPlayerDialog(playerid,503,DIALOG_STYLE_INPUT,"ID","Enter skin ID:","Continue","Cancel");
	    }
	    else
	    {
	        //setplayerskin
	        SetPlayerSkin(playerid,ListItemSkin[playerid][listitem]);
	    }
	}
	if(dialogid == 502 && response == 1)
	{
	    new SkinCount=1;
		new SkinsSTR[2048] = "New Search...\nSelect by ID...";

		for(new i;i<300;i++)
		{
		    if(SkinCount == 127)
			{
                   ShowPlayerDialog(playerid,502,DIALOG_STYLE_INPUT,"Search","Enter search keyword(s): (there were to many skins)","Continue","Cancel");
			}
			else if(strfind(SkinNames[i],inputtext, true) != -1)
			{
				format(SkinsSTR,sizeof(SkinsSTR),"%s\n%d - %s",SkinsSTR,i,SkinNames[i]);
				SkinCount++;
				ListItemSkin[playerid][SkinCount] = i;
			}
		}
		ShowPlayerDialog(playerid,501,DIALOG_STYLE_LIST,"Skin Menu by Casss",SkinsSTR,"Choose","Cancel");
	}
	if(dialogid == 503 && response == 1)
	{
	    SetPlayerSkin(playerid, strval(inputtext));
	}
	return 1;
}
Reply
#2

nice, good job. I'v never seen filterscript like this
Reply
#3

haha you used that recently released include right?
Reply
#4

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
haha you used that recently released include right?
Yeah, i wrote that include. :P
Reply
#5

nice work for beginner's
Reply
#6

Good Job =)
Reply
#7

Easy but useful
Reply
#8

Thanks. It was just because i was bored. :P
Reply
#9

Yay, thanks this is great ! Thank you
Reply
#10

Great, useful.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)