GetPlayerWeaponData Not Work
#1

Код:
if(newstate == PLAYER_STATE_WASTED)
    {
       for (new i; i<13; i++)
	{
  	   GetPlayerWeaponData(playerid, i, PlayerWeapon[playerid][i], PlayerAmmo[playerid][i]);
	}
       injured[playerid] = 1; 
            
Public SetPlayerSpawn
{
  if(injured == 1)
  {
    for (new i; i<13; i++)
    {
      SafeGivePlayerWeapon(playerid, PlayerWeapon[playerid][i], PlayerAmmo[playerid][i]);
      PlayerWeapon[playerid][i] = 0;
      PlayerAmmo[playerid][i] = 0;
    }
no weapon if i spawn
Reply
#2

Код:
if(injured = 1;)
Change it to:
Код:
if(injured == 1)
I don't know if it will solve the problem
Reply
#3

It will not. I posted this in the sa-mp bug report.

In many scenarios this function returns false values.
This function is unreliable.
Reply
#4

are you sure you don't ResetPlayerWeapons above this code?
Reply
#5

It doesn't matter, the function itself is bugged.

But yet besides that, when you die, sa-mp automaticly removes your weapons.
Reply
#6

When you die, your weapons automatically reset, you'll notice as soon as you die, look at the weapons. It changes to fist.

You could run it on a timer. Checking every second or two.

Then during the checks, to eliminate the possibility of checking while the player is dead. You can get their state, if it's wasted then return 1; to avoid gathering the weapon data.
Reply
#7

ok man
and

if i use onplayerdeath. it work ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)