Zdravim,
prichadzam sem lebo si neviem uz poradit potrebujem vytvorit urcite pole pre zbrane ktore hrac ma pri sebe nie ktoru zbran ma v ruke.. a potom pouzit to pole v podmienke if(!pole).
Napr pole[] ={14,25,26} no a ak ma hrac neaku z tychto zbrani (jednu ci dve alebo kolko) tak return 0;
ja som to skusal uz hociako ale najlepsie mi to vyslo tak asi ze jednu zbran mi to zachytilo xD
stock kupene(playerid)
{
new weapdatas[13][2];
for(new i;i<13;i++) GetPlayerWeaponData(playerid,i,weapdatas[i][0],weapdatas[i][1]);
for(new i;i<13;i++)
{
if(weapdatas[i][1] >= 1)
{
switch(weapdatas[i][0])
{
case 8,16,18,26,35,36,37,38,39,40: return true;
}
}
}
return false;
}
no a pouzil som if(!kupene)
ale nic sa nedeje
dam vam sem aj naco to potrebujem aby to bolo lahsie
new wstring[32];
new INI:file = INI_Open(UserPath(playerid));
INI_SetTag(file,"Data");
for(new s = 0; s < MAX_WEAPONS; s++)
{
GetPlayerWeaponData(playerid, s, Weapon_Info[playerid][pWeapon][s], Weapon_Info[playerid][pAmmo][s]);
if(!kupene(playerid))
{
for(new w = 0; w < MAX_WEAPONS; w++)
{
format(wstring, sizeof(wstring), "Weapon%d", w);
INI_WriteInt(file, wstring, Weapon_Info[playerid][pWeapon][w]);
}
for(new a = 0; a < MAX_WEAPONS; a++)
{
format(wstring, sizeof(wstring), "Ammo%d", a);
INI_WriteInt(file, wstring, Weapon_Info[playerid][pAmmo][a]);
}
}
}
INI_Close(file);