AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   lol (https://forums.alliedmods.net/showthread.php?t=164124)

BodyBuilder 08-07-2011 13:53

lol
 
lol

abdul-rehman 08-07-2011 13:58

Re: Run time error 4: index out of bounds
 
Why are you using emessage ? Do you even know what it does ?
Code:
ShowColorMessage(id, type, message[]) {     emessage_begin(type, get_user_msgid("SayText"), _, id)     ewrite_byte(id)             ewrite_string(message)     emessage_end() } Team_Info(id, type, team[]) {     emessage_begin(type, get_user_msgid("TeamInfo"), _, id)     ewrite_byte(id)     ewrite_string(team)     emessage_end()     return 1 }

Btw try changing this
Code:
FindPlayer() {     new i = -1     while(i <= get_maxplayers()) {     if(IsConnected[++i]) {     return i } }     return -1 }
to this :
Code:
FindPlayer() {     static maxplayers     if (!maxplayers) maxplayers = get_maxplayers()     for( new id = 1; id <= maxplayers; id++ )     {         if(IsConnected[id])             return id;     }     return -1; }
But still i'll suggest you to use a more reliable color chat, like this

bibu 08-07-2011 14:00

Re: Run time error 4: index out of bounds
 
Also getting the country and such stuff in connect is too early AFAIK, a task would be better.

fysiks 08-07-2011 21:34

Re: Run time error 4: index out of bounds
 
This kid still hasn't learned to indent correctly. . .

Quote:

Originally Posted by bibu (Post 1527726)
Also getting the country and such stuff in connect is too early AFAIK, a task would be better.

If you have an IP you can get their country.

abdul-rehman 08-08-2011 05:02

Re: Run time error 4: index out of bounds
 
Use the colorchat system i suggested in post #2


All times are GMT -4. The time now is 03:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.