I dont understand this o_O
#1

pawn Code:
GetPlayerWeaponData(playerid,i,weaponid,ammo);
      format(string,sizeof(string),"Weapon - %d",i);
      dini_IntSet(path,string,weaponid);
      format(string,sizeof(string),"AmmoID - %d",i);
      dini_IntSet(path,string,ammo == 65535 ? 0 : ammo);
This is from [FS] Weapons saving by Phyro.
Can someone explane me this line:
Code:
dini_IntSet(path,string,ammo == 65535 ? 0 : ammo);
What this does: ammo == 65535 ? 0 : ammo);
I dont have experience with ? : etc.
Reply
#2

Ask in that scripts thread.
Reply
#3

https://sampwiki.blast.hk/wiki/Control_Structures#.3F:

It's the same as writing:

if(ammo == 65535) value = 0;
else value = ammo;

Or code to that effect. It will store 0 if the ammo is 65535, or will store the value of ammo otherwise.
Reply


Forum Jump:


Users browsing this thread: