[Clothing System]
#1

Anybody can help me to create a clothing system?

hmm like this

/buyclothes [skinid] and it will cost $500

Thanks
Reply
#2

Found this with a little SEARCH:

http://forum.sa-mp.com/showthread.ph...hlight=clothes
Reply
#3

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Hmm that was nice, but i need system with skin id
Reply
#4

Код:
CMD:setskin(playerid,params[])
{
	new id;
	if(sscanf(params,"i",id)) return SendClientMessage(playerid,red,"USAGE:/setskin [skin id]");
	SetPlayerSkin(playerid, id);
	GivePlayerMoney(playerid, -500);
	if(GetPlayerSkin(playerid) == id) SendClientMessage(playerid,COLOR_ORANGE,"*Skin changed.");
	else SendClientMessage(playerid,red,"Invalid skin id.");
	return 1;
}
just change the cmd name to what ever you like
Reply
#5

Код:
if(strcmp(cmd, "/clothes", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pMember] >= 1)
	        {
	            if(IsAtClothShop(playerid))
				{
				    if(PlayerInfo[playerid][pMember] == 1) { ChosenSkin[playerid] = 280; SetPlayerSkin(playerid, 280); }
					else if(PlayerInfo[playerid][pMember] == 2) { ChosenSkin[playerid] = 286; SetPlayerSkin(playerid, 286); }
					else if(PlayerInfo[playerid][pMember] == 3) { ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
					if(PlayerInfo[playerid][pMember] == 4) { ChosenSkin[playerid] = 70; SetPlayerSkin(playerid, 70); }
					else if(PlayerInfo[playerid][pMember] == 5) { ChosenSkin[playerid] = 117; SetPlayerSkin(playerid, 117); }
					else if(PlayerInfo[playerid][pMember] == 6) { ChosenSkin[playerid] = 111; SetPlayerSkin(playerid, 111); }
					else if(PlayerInfo[playerid][pMember] == 8) { ChosenSkin[playerid] = 249; SetPlayerSkin(playerid, 249); }
					else if(PlayerInfo[playerid][pMember] == 9) { ChosenSkin[playerid] = 148; SetPlayerSkin(playerid, 148); }
					else if(PlayerInfo[playerid][pJob] == 13) { ChosenSkin[playerid] = 255; SetPlayerSkin(playerid, 255); }
					else if(PlayerInfo[playerid][pMember] == 11) { ChosenSkin[playerid] = 59; SetPlayerSkin(playerid, 59); }
					else if(PlayerInfo[playerid][pMember] == 14) { ChosenSkin[playerid] = 169; SetPlayerSkin(playerid, 169); }
					else if(PlayerInfo[playerid][pMember] == 15) { ChosenSkin[playerid] = 127; SetPlayerSkin(playerid, 127); }
					else if(PlayerInfo[playerid][pMember] == 16) { ChosenSkin[playerid] = 184; SetPlayerSkin(playerid, 184); }
					else { return 1; }
					GetPlayerPos(playerid, ChangePos[playerid][0],ChangePos[playerid][1],ChangePos[playerid][2]);
					ChangePos2[playerid][0] = GetPlayerInterior(playerid);
					ChangePos2[playerid][1] = 1;
					ChangePos3[playerid] = GetPlayerVirtualWorld(playerid);
				    SafeSetPlayerInterior(playerid,0);
					new rand = random(sizeof(gInviteSpawns));
					SafeSetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
					SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
					SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
					SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
					TogglePlayerControllable(playerid, 0);
					SelectChar[playerid] = 255;
					SelectCharID[playerid] = PlayerInfo[playerid][pMember];
					SelectCharPlace[playerid] = 1;
					PlayerInfo[playerid][pModel] = ChosenSkin[playerid];
			    	PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
				    SendClientMessage(playerid, COLOR_LIGHTRED, "* Use 'next' to Select the char you want to use.");
				    SendClientMessage(playerid, COLOR_LIGHTRED, "* If you've found the Char you want to use, type 'done'.");
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   You are not in a Clothing Shop !");
					return 1;
				}
	        }
	        else
	        {
	            if(IsAtClothShop(playerid))
	            {
	                if(PlayerInfo[playerid][pSex] == 1) { ChosenSkin[playerid] = 2; SetPlayerSkin(playerid, 2); PlayerInfo[playerid][pChar] = 2; }
	                else if(PlayerInfo[playerid][pSex] == 2) { ChosenSkin[playerid] = 55; SetPlayerSkin(playerid, 55); PlayerInfo[playerid][pChar] = 55; }
	                else { return 1; }
	                GetPlayerPos(playerid, ChangePos[playerid][0],ChangePos[playerid][1],ChangePos[playerid][2]);
					ChangePos2[playerid][0] = GetPlayerInterior(playerid);
					ChangePos2[playerid][1] = 1;
					ChangePos3[playerid] = GetPlayerVirtualWorld(playerid);
					SafeSetPlayerInterior(playerid,0);
					new rand = random(sizeof(gInviteSpawns));
					SafeSetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
					SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
					SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
					SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
					TogglePlayerControllable(playerid, 0);
					SelectChar[playerid] = 255;
					if(PlayerInfo[playerid][pSex] == 1) { SelectCharID[playerid] = 20; }
					else if(PlayerInfo[playerid][pSex] == 2) { SelectCharID[playerid] = 30; }
					else { return 1; }
					SelectCharPlace[playerid] = 1;
					PlayerInfo[playerid][pModel] = ChosenSkin[playerid];
					PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
					SendClientMessage(playerid, COLOR_LIGHTRED, "* Use 'next' to Select the char you want to use.");
				    SendClientMessage(playerid, COLOR_LIGHTRED, "* If you've found the Char you want to use, type 'done'.");
	            }
	        }
	    }
	    return 1;
	}
Thats my script for /clothes, can you change it?
Reply
#6

Sorry do posting, Anyone can help?
Reply
#7

Maybe this can help

https://sampforum.blast.hk/showthread.php?tid=60168
Reply
#8

My Friend give some script to me

Код:
  if(strcmp(cmd, "/buyclothes", true) == 0)
        {
		   if(IsPlayerConnected(playerid))
		   {
			  if(PlayerInfo[playerid][pMember] >= 1)
			  {
				 if(IsAtClothShop(playerid))
				 {
					tmp=strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_GRAY, "USAGE: /buyclothes [skinid]");
						return 1;
					}
					
					SetPlayerSkin(playerid, id);
					GivePlayerMoney(playerid, -500);
					if(GetPlayerSkin(playerid) == id) SendClientMessage(playerid, COLOR_ORANGE, "Skin Changed.");
					else SendClientMessage(playerid, COLOR_RED, "Wrong Skin ID.");
					return 1;
				 }
    {
Thats right?
Reply
#9

It depends, it's not like someone can pass you a script and then you can just copy+paste it inside your script.

Try implement the script into your own script first, and then if you got any errors (most likely you will, if you don't know what're you doing) you can post it here and ask for help.

Edit: Good luck/Semoga beruntung.
Reply
#10

its simple i though for the cash

pawn Код:
GivePlayerMoney(playerid, -500);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)