21.07.2013, 10:01
Following question:
I've made a serversided anti-weapon hack. Sometimes it's kinda buggy, because it detects player, who have no guns. So I've tried to skip players without guns in the weapon-check for the specific slot (Like Player1 has in slot 0 no guns -> The check skips this slot and continue checking for slot 1, and so on..).
How can I return to the for()-loop without stopping the whole function?
Thanks for help
I've made a serversided anti-weapon hack. Sometimes it's kinda buggy, because it detects player, who have no guns. So I've tried to skip players without guns in the weapon-check for the specific slot (Like Player1 has in slot 0 no guns -> The check skips this slot and continue checking for slot 1, and so on..).
Код:
public ACSUpdate(playerid)
{
if(GetPVarInt(playerid, "Spawned") == 1)
{
for(new slot; slot < 11; slot++)
{
GetPlayerWeaponData(playerid, slot, WeaponCheck[playerid][slot], WeaponAmmoCheck[playerid][slot]);
if(WeaponCheck[playerid][slot] == 0 && WeaponAmmoCheck[playerid][slot] == 0) return 0; // Here is the problem..
if(Weapon[playerid][slot] != WeaponCheck[playerid][slot] || WeaponAmmo[playerid][slot] - WeaponAmmoCheck[playerid][slot] < 0 || WeaponAmmoCheck[playerid][slot] < 0)
{
ACSKick(playerid, "Waffen/Ammo Hack");
}
}
}
return 1;
}
Thanks for help


