1) it looks right but i would rather suggest this:
Code:
public check_wep(id){
new weapons[32], alright[32]
new numWeapons,i
get_user_weapons(id,weapons,numWeapons)
for( i = 0; i < numWeapons; i++ ){
alright[i] = wep_ok(id,weapons[i],i)
}
strip_user_weapons(id)
for( i = 0; i < numWeapons; i++ ){
if(alright[i] != -1){
give_coitem(id,weapons[i]) // should not this be weapons[i] ?
}
}
}
eg: if u have 15 weaps and 5 are not allowed
yours does
- gets weaps, first not allowed, stripp all weaps, give 14 weaps, call func again
- gets weaps, next is allowed
- next not allowed, stripp all weaps, give 13 weaps, call func again ...
the above does:
- gets weaps, check which are allowed, stripp all weaps, give only allowed weaps
with give_coitem(id,weapid) i think u pass the id of the weapon to this function check which weap it is and then use give_item(id,<weap name>) , right?
__________________