How do i add more skins slots?
#1

I was looking deeply in this code trying to update organization skins up to 5.But i couldn't do it..always giving 3 skins max like it was before.Please help out.Thanks in advance.
Code:
CMD:orgskins(playerid, params[])
{
	new orgid, skin1, skin2, skin3, string[256];
	if (adlvl[playerid] < 6) return 0;
	if (sscanf(params, "dd", orgid, skin1)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /orgskins [orgid] [skin1] [skin2] [skin3]");
	sscanf(params, "ddd", orgid, skin1, skin2);
	sscanf(params, "dddd", orgid, skin1, skin2, skin3);
	format(string, 10, "org%d", orgid);
	if (!dini_Exists(AddDirFile(dir_orgfiles, string))) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid organization id.");
	if (skin1 < 0 || skin1 > 299 || skin1 == 74 || skin2 < 0 || skin2 > 299 || skin2 == 74 || skin3 < 0 || skin3 > 299 || skin3 == 74 || skin1 == 0 || (skin2 == 0 && skin3 != 0)) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid skin id.");
	dini_IntSet(AddDirFile(dir_orgfiles, string), "skin1", skin1);
	dini_IntSet(AddDirFile(dir_orgfiles, string), "skin2", skin2);
	dini_IntSet(AddDirFile(dir_orgfiles, string), "skin3", skin3);
	if (skin2 != 0)
	{
		if (skin3 != 0) format(string, sizeof(string), "%s's skins changed to %d, %d and %d.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), skin1, skin2, skin3);
		else format(string, sizeof(string), "%s's skins changed to %d and %d.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), skin1, skin2);
	}
	else format(string, sizeof(string), "%s's skins changed to %d.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), skin1);
	SendClientMessage2(playerid, COLOR_SILVER, string);
	return 1;
}
Reply
#2

It might be defined in your script for a max amount of skins that can be owned. If you find it, change it from there.

Then add more onto this line:
PHP Code:
new orgidskin1skin2skin3string[256]; 
Reply
#3

why 256?!

PHP Code:
string[256]; 
64 is enough

PHP Code:
string[64
Reply
#4

Quote:
Originally Posted by aoky
View Post
It might be defined in your script for a max amount of skins that can be owned. If you find it, change it from there.

Then add more onto this line:
PHP Code:
new orgidskin1skin2skin3string[256]; 
Should anything be changed here ??

Code:
CMD:oskin(playerid, params[])
{
	new string[25], tmp[256];
	new giveplayerid = GetPVarInt(playerid, "playerorg");
	if (giveplayerid == 0) return SendClientMessage2(playerid, COLOR_RED, "Error: You aren't in an organization!");
	if ((IsALaw(playerid) || orgcata[giveplayerid-1] == 3) && GetPlayerWantedLevel(playerid) != 0) return SendClientMessage2(playerid, COLOR_RED, "You are a wanted player!");
	format(string, 10, "org%d", giveplayerid);
	new moneys1 = dini_Int(AddDirFile(dir_orgfiles, string), "skin1");
	if (moneys1 == 0) return SendClientMessage2(playerid, COLOR_SILVER, "Your organization doesn't have any skins yet.");
	if (GetPVarInt(playerid, "podfskin") != -1)
	{
		new temp1 = dini_Int(AddDirFile(dir_orgfiles, string), "skin4");
		if (GetPlayerSkin(playerid) == moneys1)
		{
			if (temp1 != 0)
			{
				SetPlayerSkinEx(playerid, temp1);
				SetPVarInt(playerid, "podfskin", temp1);
			}
		}
		else if (GetPlayerSkin(playerid) == temp1)
		{
			new temp2 = dini_Int(AddDirFile(dir_orgfiles, string), "skin5");
			if (temp2 != 0)
			{
				SetPlayerSkinEx(playerid, temp2);
				SetPVarInt(playerid, "podfskin", temp2);
			}
			else
			{
				SetPlayerSkinEx(playerid, moneys1);
				SetPVarInt(playerid, "podfskin", moneys1);
			}
		}
		else
		{
			SetPlayerSkinEx(playerid, moneys1);
			SetPVarInt(playerid, "podfskin", moneys1);
		}
	}
	else
	{
		SetPlayerSkinEx(playerid, moneys1);
		SetPVarInt(playerid, "podfskin", moneys1);
	}
	format(tmp, 12, "0x%sFF", dini_Get(AddDirFile(dir_orgfiles, string), "color"));
	SetPlayerColor(playerid, HexToInt(tmp));
	if (GetPVarInt(playerid, "playercolor") != -1) SetPVarInt(playerid, "playercolor", -1);
	SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Switched organization skin.");
	if (IsALaw(playerid) || orgcata[GetPVarInt(playerid, "playerorg")-1] == 3 )
	{
		if(onduty[playerid] == 0)
		{
			SendClientMessage2(playerid, HexToInt(tmp), "You are now ON duty.");
			onduty[playerid] = 1;
		}
	}
	return 1;
}
Reply
#5

Looks like it's fr/rp script right?
Reply
#6

Quote:
Originally Posted by Wikanzzx
View Post
Looks like it's fr/rp script right?
Does it really matter?

______________________

Why the fuck dude, Do you want the skin be saved?

Well.

You can add a feature under OnPlayerDisconnect which saves the player skin from GetPlayerSkin feature.

You can also add feature to set the player skin due to if he got killed, He won't lose his skin, Which is like User[playerid][Skin].

Sorry If i were wrong, I didn't used dini saving system before, I just used Y_INI, SQLite Database and MySQL.
Reply
#7

No, just saying.. sorry for spamming
Reply
#8

Yeah it is.But how do if fix this tho, i mean change it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)