AlliedModders

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

WaZZeR++ 03-14-2005 13:31

hpk immunity
 
hi can i change:
Code:

                        new Name[32],Auth[35]
                        get_user_name(id,Name,31)
                        get_user_authid(id,Auth,34)
                        client_print(0,print_chat,"[HPK] %s was kicked for having a ping above %d",Name,g_MaxPing)
                        server_cmd("kick #%d To high a ping",get_user_userid(id))
                        log_amx("%s<%s> was kicked for having to high a ping (was %d)",Name,Auth,ping)
                        return PLUGIN_CONTINUE

to amx_kick to give the admin immunity?

teame06 03-14-2005 14:40

Code:
if (get_user_flags(id) & ATAC_IMMUNITY_LEVEL)          return PLUGIN_CONTINUE          new Name[32],Auth[35]          get_user_name(id,Name,31)          get_user_authid(id,Auth,34)          client_print(0,print_chat,"[HPK] %s was kicked for having a ping above %d",Name,g_MaxPing)          server_cmd("kick #%d To high a ping",get_user_userid(id))          log_amx("%s<%s> was kicked for having to high a ping (was %d)",Name,Auth,ping)          return PLUGIN_CONTINUE
[/small]

WaZZeR++ 03-14-2005 16:27

ATAC_IMMUNITY_LEVEL, what is ATAC?

Sp4rt4n 03-14-2005 16:34

you probably have the atac plugin... atac = advanced team attack control

WaZZeR++ 03-14-2005 16:40

but i dont have it...., will it be ADMIN_IMMUNITY then?

Sp4rt4n 03-14-2005 17:39

oh, oh, oh... i see what you mean... it would be this then:

Code:
if (get_user_flags(id) & ADMIN_KICK)          return PLUGIN_CONTINUE          new Name[32],Auth[35]          get_user_name(id,Name,31)          get_user_authid(id,Auth,34)          client_print(0,print_chat,"[HPK] %s was kicked for having a ping above %d",Name,g_MaxPing)          server_cmd("kick #%d To high a ping",get_user_userid(id))          log_amx("%s<%s> was kicked for having to high a ping (was %d)",Name,Auth,ping)          return PLUGIN_CONTINUE

WaZZeR++ 03-15-2005 09:26

it dident woked, i got a error msg..."warning 217: loose indentation"I give you the whole section

Code:
stock CheckPing(id) {     new TempString[5]     get_user_info(id,"cl_updaterate",TempString,4)         new ping,loss     get_user_ping(id,ping,loss)     new clrate = str_to_num(TempString)         if(ping > g_MaxPing)     {         if(ping >= ExtraPing+g_MaxPing) g_PingOffence[id] = g_PingOffence[id] + 5       // If the user has a ping ExtraPing + g_MaxPing, he gets +5 instead of +1 in his ping offence counter         else g_PingOffence[id]++                 if(g_PingOffence[id] >= HowManyChecks)         {         if (get_user_flags(id) & ADMIN_KICK)             return PLUGIN_CONTINUE             new Name[32],Auth[35]             get_user_name(id,Name,31)             get_user_authid(id,Auth,34)             client_print(0,print_chat,"[HPK] %s was kicked for having a ping above %d",Name,g_MaxPing)             server_cmd("kick #%d To high a ping",get_user_userid(id))             log_amx("%s<%s> was kicked for having to high a ping (was %d)",Name,Auth,ping)             return PLUGIN_CONTINUE         }         client_print(id,print_chat,"[HPK] You ping is above %d, either fix your ping or leave",g_MaxPing)     }     if(clrate < g_MinRate &&  ( g_CheckPlayer[id] == 1 || g_CheckPlayer[id] == 3))     {         if(g_CheckPlayer[id] == 3)             g_CheckPlayer[id] = 2         else         {             g_CheckPlayer[id] = 2             ShowMenu(id)         }     }     else if(clrate < g_MinRate && g_CheckPlayer[id] == 2)     {     if (get_user_flags(id) & ADMIN_KICK)         return PLUGIN_CONTINUE         new Name[32],Auth[35]         get_user_name(id,Name,31)         get_user_authid(id,Auth,34)         client_print(0,print_chat,"[HPK] %s was kicked for having a to low cl_updaterate(%d)",Name,clrate)         server_cmd("kick #%d To low a cl_updaterate",get_user_userid(id))           log_amx("%s<%s> was kicked for having to low a cl_updaterate (was %d)",Name,Auth,clrate)         return PLUGIN_CONTINUE     } //  client_print(0,3,"%d had ping: %d(%d) loss %d clrate %d(%d)",id,ping,g_MaxPing,loss,clrate,g_MinRate)     return PLUGIN_CONTINUE }

the erros is on the new lines under the PLUGIN_CONTINU

XunTric 03-15-2005 09:33

"warning 217: loose indentation" doesnt do anything at your script at all...
Umm this is hard to exlain.
Like for all new commands in "{}" you press space 4 times and write the cmd.
So then maybe the warning line has 3 or 5 spaces instead.
If you understand what I mean...
Just compile, see what line the warning is on, then check if you got right amount of spaces.
(4 spaces inst a must. You can use 10 spaces if you want, aslong as it is that on all lines)

WaZZeR++ 03-15-2005 09:39

ok, i get it, wierd language...:p

WaZZeR++ 03-15-2005 09:48

i cant get i right..... line 111 and 135

Code:
stock CheckPing(id) {     new TempString[5]     get_user_info(id,"cl_updaterate",TempString,4)         new ping,loss     get_user_ping(id,ping,loss)     new clrate = str_to_num(TempString)         if(ping > g_MaxPing)     {         if(ping >= ExtraPing+g_MaxPing) g_PingOffence[id] = g_PingOffence[id] + 5       // If the user has a ping ExtraPing + g_MaxPing, he gets +5 instead of +1 in his ping offence counter         else g_PingOffence[id]++                 if(g_PingOffence[id] >= HowManyChecks)         {             if (get_user_flags(id) & ADMIN_KICK)                 return PLUGIN_CONTINUE                 new Name[32],Auth[35]   ;line 111                 get_user_name(id,Name,31)                 get_user_authid(id,Auth,34)                 client_print(0,print_chat,"[HPK] %s was kicked for having a ping above %d",Name,g_MaxPing)                 server_cmd("kick #%d To high a ping",get_user_userid(id))                 log_amx("%s<%s> was kicked for having to high a ping (was %d)",Name,Auth,ping)                 return PLUGIN_CONTINUE         }         client_print(id,print_chat,"[HPK] You ping is above %d, either fix your ping or leave",g_MaxPing)     }     if(clrate < g_MinRate &&  ( g_CheckPlayer[id] == 1 || g_CheckPlayer[id] == 3))     {         if(g_CheckPlayer[id] == 3)             g_CheckPlayer[id] = 2         else         {             g_CheckPlayer[id] = 2             ShowMenu(id)         }     }     else if(clrate < g_MinRate && g_CheckPlayer[id] == 2)     {         if (get_user_flags(id) & ADMIN_KICK)             return PLUGIN_CONTINUE             new Name[32],Auth[35]    ;line135             get_user_name(id,Name,31)             get_user_authid(id,Auth,34)             client_print(0,print_chat,"[HPK] %s was kicked for having a to low cl_updaterate(%d)",Name,clrate)             server_cmd("kick #%d To low a cl_updaterate",get_user_userid(id))               log_amx("%s<%s> was kicked for having to low a cl_updaterate, it was %d",Name,Auth,clrate)             return PLUGIN_CONTINUE     } //  client_print(0,3,"%d had ping: %d(%d) loss %d clrate %d(%d)",id,ping,g_MaxPing,loss,clrate,g_MinRate)     return PLUGIN_CONTINUE }

i dont have the ;line 111/135 in the script....

se what is wrong?


All times are GMT -4. The time now is 14:07.

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