weapon change issue
#1

i scripted a minigame like gungame, I am facing a issuse with the weapon reset.

Код:
public OnPlayerUpdate(playerid)
{
     if(PlayerStatus[playerid][dead] == false)
         {
	        if(!GetPlayerWeapon(playerid))
            {
                    if(PlayerStatus[playerid][pw] == true)
                    {
                            GivePlayerWeapon(playerid, 4, 1);
                            PlayerStatus[playerid][pw] = false;
                    }
                    else
                    {
                           GivePlayerWeapon(playerid, Weaps[PlayerStatus[playerid][glevel]], 99999);
                           PlayerStatus[playerid][pw] = true;
                    }
            }
            else PlayerStatus[playerid][pw] = GetPlayerWeapon(playerid) == 4 ? false : true;
        }
        return 1;
}
i gives me the next level weapon but not removing the old level weapon.

example
Level 1 - Mp5
Level 2 - ak47

When i kill someone I level up to 2 and i get ak47 but i have mp5 with me.

when i use SetPlayerArmedWeapon it doesn't give me weapon on re-spawn, only giveplayerweapon works.

There is no error log when i use SetPlayerArmedWeapon!
Reply
#2

Hi,

You can use ResetPlayerWeapons(playerid) before giving a new weapon.
Reply
#3

Quote:
Originally Posted by Sielly
Посмотреть сообщение
Hi,

You can use ResetPlayerWeapons(playerid) before giving a new weapon.
Thanks I fixed it, +rep for the reply!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)