02.04.2018, 13:07
i scripted a minigame like gungame, I am facing a issuse with the weapon reset.
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!
Код:
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; }
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!