26.03.2016, 18:47
Hi!
You have to write it like this:
When you take your version, it would look like this:
The field 43 is nothing. I hope you understand how I mean it.
You have to write it like this:
PHP код:
RemoveWeaponFromPlayer(playerid,weaponid)
{
new Ammo;
SetPlayerArmedWeapon(playerid,weaponid);
Ammo = GetPlayerAmmo(playerid);
for(new i;i<sizeof(e_ValidWeapon);i++)
{
if(weaponid != e_ValidWeapon[i])continue;
print("Executed.");
GivePlayerWeapon(playerid,weaponid,-Ammo);
break;
}
return 1;
}
PHP код:
weaponid = 43
PHP код:
if(weaponid != e_ValidWeapon[weaponid]) return false;
PHP код:
if(43 != e_ValidWeapon[43])return false;
PHP код:
new e_ValidWeapon[] =
{
0, //1
3, //2
4, //3
5, //4
8, //5
9, //6
15, //7
22, //8
23, //9
24, //10
25, //11
27, //12
28, //13
29, //14
30, //15
31, //16
32, //17
33, //18
34, //19
41, //20
42, //21
43 //...
// 43
};