Hey Karim004,
Thanks for the help, I have it working now. I have a suggestion, although I think you are already working on it judging by your last post, but here it is anyway.
You could simply get rid of the different type of ad (eg. Adsense, Amazon etc) and just have the one box that allows you to put in any code. Allow the end user to specify a code separator (eg. ***CODE***) that allows your plugin to determine which code to use when displaying random banners. I would imagine this would be much easy to code for you, rather than having to cater to all these different ad types.
This is exactly what the plug in "
Who Sees Ads" for Wordpress does, and it won awards. This would make the whole thing much more intuitive and allow complete control for ads. If you need some more information about Who Sees Ads, I am using it on my Wordpress Install and can help.
Otherwise, this seems to be the best for vBulletin and we should all be thanking you for your hard work.