Brass Knuckles stuck on player's hand
#1

Hello again! ©

I've made a command to /conceal brass knuckes, to RP'ly hide them so noone can MG it and so you don't get unfair buffs in a melee fight. The only problem is that the knuckles are still stuck on one's hand when he conceals them.
I am assured it's a well-known issue, but I haven't found anything to help me rid of it, unfortunately.
Here's the command.

Code:
CMD:conceal(playerid) //CMD to conceal/reveal knuckles
{
    if(CMDCheck(playerid, 1)) return 1; // 1 - IC; 2 - OOC; 3 - Anim
    if(PlayerInfo[playerid][pSlot][0] == 0) return SendClientMessage(playerid, COLOR_GREY, "You need to have knuckles in order to conceal/reveal them!");
	new str[128], i;
	if(PKnucklesConcealed[playerid] == 1)
	{
		GiveWeapon(playerid, 1, 1);
		format(str, sizeof(str), "> %s reaches for one of the pockets, taking out brass knuckles as he puts them on the fist.", GetPName(playerid));
                SetPlayerChatBubble(playerid, str, COLOR_PURPLE, 50.0, 10000);
		SendLongMessage(playerid, COLOR_PURPLE, str);
		PKnucklesConcealed[playerid] = 0;
	}
	else
	{
	    if(GetPlayerWeapon(playerid) != 1) return SendClientMessage(playerid, COLOR_GREY, "You must have your brass knuckles on hands to conceal them!");
            SetWeaponData(playerid, 0, 0, 0);
            ResetPlayerWeapons(playerid);
            for(new w = 0; w < 12; w++) GivePlayerWeapon(playerid, PlayerInfo[playerid][pSlot][w], PlayerInfo[playerid][pSlotA][w]);
            SetWeaponData(playerid, 0, 1, 1);//SetWeaponData only sets player's data; it doesn't hand out any weapons whatsoever - I do this so if a player leaves the server with knuckles concealed, he can still get it back upon logging in.
            format(str, sizeof(str), "> %s takes brass knuckles off the fist, putting it in one of the pockets.", GetPName(playerid));
            SetPlayerChatBubble(playerid, str, COLOR_PURPLE, 50.0, 10000);
	    SendLongMessage(playerid, COLOR_PURPLE, str);
	    PKnucklesConcealed[playerid] = 1;
	}
	ICLog(str);
	return 1;
}
It's been playtested and it works. What is it I must do to deal with stuck knuckles?
On player's screen, knuckles disappear, whilst the others can still see it on one's hand, if to be more exact.
That would be preffered to avoid respawning players for obvious reasons.
Reply


Messages In This Thread
Brass Knuckles stuck on player's hand - by Maxandmov - 09.05.2018, 09:39

Forum Jump:


Users browsing this thread: 2 Guest(s)