SA-MP Forums Archive
Need help ... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help ... (/showthread.php?tid=335226)



Need help ... - Edvin - 17.04.2012

Hi.

Some days ago i created new ranks on my server, and i put this code:
Код:
switch( PlayerInfo[ i ][ Kills ] )
	    {
			case 0 .. 99:        PlayerInfo[ i ][ Rank ] = 1;
		    case 100 .. 199:     PlayerInfo[ i ][ Rank ] = 2;
		    case 200 .. 279:     PlayerInfo[ i ][ Rank ] = 3;
		    case 280 .. 499:     PlayerInfo[ i ][ Rank ] = 4;
		    case 500 .. 599:     PlayerInfo[ i ][ Rank ] = 5;
		    case 600 .. 749:     PlayerInfo[ i ][ Rank ] = 6;
		    case 750 .. 999:     PlayerInfo[ i ][ Rank ] = 7;
		    case 1000 .. 1299:   PlayerInfo[ i ][ Rank ] = 8;
		    case 1300 .. 1499:   PlayerInfo[ i ][ Rank ] = 9;
		    case 1500 .. 1599:   PlayerInfo[ i ][ Rank ] = 10;
		    case 1600 .. 1649:   PlayerInfo[ i ][ Rank ] = 11;
		    case 1650 .. 1799:   PlayerInfo[ i ][ Rank ] = 12;
		    case 1800 .. 2099:   PlayerInfo[ i ][ Rank ] = 13;
		    case 2100 .. 2399:   PlayerInfo[ i ][ Rank ] = 14;
		    case 2400 .. 2799:   PlayerInfo[ i ][ Rank ] = 15;
		    case 2800 .. 3299:   PlayerInfo[ i ][ Rank ] = 16;
		    case 3300 .. 3999:   PlayerInfo[ i ][ Rank ] = 17;
		    case 4000 .. 4999:   PlayerInfo[ i ][ Rank ] = 18;
		    case 5000 .. 5499:   PlayerInfo[ i ][ Rank ] = 19;
		    case 5500 .. 6199:   PlayerInfo[ i ][ Rank ] = 20;
		    case 6200 .. 6999:   PlayerInfo[ i ][ Rank ] = 21;
		    case 7000 .. 8999:   PlayerInfo[ i ][ Rank ] = 22;
		    case 9000 .. 9399:   PlayerInfo[ i ][ Rank ] = 23;
		    case 9400 .. 9999:   PlayerInfo[ i ][ Rank ] = 24;
		    case 10000 .. 14999: PlayerInfo[ i ][ Rank ] = 25;
		    case 15000 .. 19999: PlayerInfo[ i ][ Rank ] = 26;
		    case 20000 .. 21499: PlayerInfo[ i ][ Rank ] = 27;
		    case 21500 .. 24999: PlayerInfo[ i ][ Rank ] = 28;
		    case 25000 .. 28999: PlayerInfo[ i ][ Rank ] = 29;
		    case 29000 .. 30999: PlayerInfo[ i ][ Rank ] = 30;
		    case 31000 .. 37999: PlayerInfo[ i ][ Rank ] = 31;
		    case 38000 .. 44999: PlayerInfo[ i ][ Rank ] = 32;
		    default: 			 PlayerInfo[ i ][ Rank ] = 33;
	    }
and when i leave this code withou /* and */ the compiler runs very slowly and the AMX is 1.600 kb, and when i put this code on /* */ compiler works perfectlly and the AMX is 1.300 kb. What is wrog with this code?


Re: Need help ... - aRoach - 17.04.2012

Where did you put this snippet of code ?


Re: Need help ... - Edvin - 17.04.2012

On a timer ...


Re: Need help ... - Ubuntu - 17.04.2012

It's normal that the AMX runs slowly you're asking him to do a big job.

By the way uhm timers isn't good...


Re: Need help ... - Edvin - 17.04.2012

Quote:
Originally Posted by Ubuntu
Посмотреть сообщение
It's normal that the AMX runs slowly you're asking him to do a big job.

By the way uhm timers isn't good...
On oldest version on my server i have just 12 ranks, and the amx don't have been 1.600 kbs ...


Re: Need help ... - Ubuntu - 17.04.2012

Quote:

and when i leave this code withou /* and */ the compiler runs very slowly and the AMX is 1.600 kb, and when i put this code on /* */ compiler works perfectlly and the AMX is 1.300 kb. What is wrog with this code?

+300kb.


Re: Need help ... - Edvin - 17.04.2012

Quote:
Originally Posted by Ubuntu
Посмотреть сообщение
+300kb.
Hey, if you want to help me, just help me, if you want to post useless posts just stay in your bank.

So ... others, what can i do? Some ideas?


Re: Need help ... - MP2 - 17.04.2012

Instead of doing that crap, just set their level when you give them score and save it.


Re: Need help ... - PrawkC - 17.04.2012

Thats a huge chunk of code, even though you're using " .. " to make it appear smaller, it is still pretty much as large, seeing as you've added this code the size increases thus the complie time has increased.