View Single Post
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 04-29-2020 , 18:59   Re: [CSGO] Donate System (Like Twitch) (ZephStore)
Reply With Quote #5

Quote:
Originally Posted by ShD3luxe View Post
Instead of using the else if syntax you can use a loop, makes the code more clear and easier to read.

An example:
Code:
		char SOUNDS_PACK[][] = {
			"",
			"TurkModders/Donate/ses_1.mp3",
			"TurkModders/Donate/ses_2.mp3",
			"TurkModders/Donate/ses_3.mp3",
			"TurkModders/Donate/ses_4.mp3",
			"TurkModders/Donate/ses_5.mp3",
			"TurkModders/Donate/ses_6.mp3",
			"TurkModders/Donate/ses_7.mp3",
			"TurkModders/Donate/ses_8.mp3",
			"TurkModders/Donate/ses_9.mp3",
			"TurkModders/Donate/ses_10.mp3"
		};

		for(int i = 0;i < sieof(SOUNDS_PACK)-1;i++)
		{
			if(StrEqual(ses[client],SOUNDS_PACK[i])) 
			{
				FormatEx(ses[client], sizeof(ses[]), SOUNDS_PACK[i+1]);
				break;
			}
		}
                EmitSoundToClient(client, ses[client]);
tbh, I even didnt check the plugin after its done. I just wanted share it for free

But thanks for the info
__________________
vortex. is offline