ZerotoHero
New member
- Messages
- 11
- Points
- 0
can somebody help me to edit autoloot script, so any player in level 50 or higher can't do the auto loot command
thanks for your help
thanks for your help
wow ty for this mate
We can have that check by followingI'd src edit it or complicate the NPC a bit, since you may have it enabled, reach to lvl 50 and this script would make it unable to disable it via the command, thus having autoloot till you relog. Also... Seems you never use the atcommand by the useatcmd script command?
OnPCBaseLvUpEvent:if (BaseLevel >=50){ atcommand "@autoloot 0";}
thanks for the answer sir, but my another question is when your level are below 50, the autoloot command seems not working and no effect at allWe can have that check by followingI'd src edit it or complicate the NPC a bit, since you may have it enabled, reach to lvl 50 and this script would make it unable to disable it via the command, thus having autoloot till you relog. Also... Seems you never use the atcommand by the useatcmd script command?
OnPCBaseLvUpEvent:if (BaseLevel >=50){ atcommand "@autoloot 0";}
- script atcmd_example -1,{OnInit: bindatcmd "autoloot",strnpcinfo(3)+"::OnAtcommand"; end;OnAtcommand: if (BaseLevel >= 50) { dispbottom "You can't use this command."; } else { useatcmd .@atcmd_command$; } end;OnPCBaseLvUpEvent: if (BaseLevel >= 50) { atcommand "@autoloot 0"; } end;}
Noo,, Script can work well...it's because it's binded, meaning everything that's been in the script, that will be done.
the best thing to do is write a plugin to overwrite the command
- script atcmd_example -1,{OnInit: bindatcmd "autoloot",strnpcinfo(3)+"::OnAtcommand"; end;OnAtcommand: if (BaseLevel >= 50) { dispbottom "You cannot use this command."; } else { atcommand "@autoloot "+atoi(.@atcmd_parameters$); } end;OnPCBaseLvUpEvent: if (BaseLevel >= 50) { atcommand "@autoloot 0"; } end;}
diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex 719b140..2b0770d 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -64,7 +64,7 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) { if( *name == atcommand->at_symbol || *name == atcommand->char_symbol ) name++; // for backwards compatibility - ARR_FIND( 0, atcommand->binding_count, i, strcmp(atcommand->binding[i]->command, name) == 0 );+ ARR_FIND( 0, atcommand->binding_count, i, strcmpi(atcommand->binding[i]->command, name) == 0 ); return ( i < atcommand->binding_count ) ? atcommand->binding[i] : NULL; }
I think bindatcmd was not overwriting original cmd properly, Cause bindatcmd was case sensitive , so it can still
be used by converting cmd letters to uppercase/lowercase
e.g.
@AUToloot 100
require modification on atcommand.c to make it non -case -sensitive
diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex 719b140..2b0770d 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -64,7 +64,7 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) { if( *name == atcommand->at_symbol || *name == atcommand->char_symbol ) name++; // for backwards compatibility - ARR_FIND( 0, atcommand->binding_count, i, strcmp(atcommand->binding->command, name) == 0 );+ ARR_FIND( 0, atcommand->binding_count, i, strcmpi(atcommand->binding->command, name) == 0 ); return ( i < atcommand->binding_count ) ? atcommand->binding : NULL; }
I think bindatcmd was not overwriting original cmd properly, Cause bindatcmd was case sensitive , so it can still
be used by converting cmd letters to uppercase/lowercase
e.g.
@AUToloot 100
require modification on atcommand.c to make it non -case -sensitive
diff --git a/src/map/atcommand.c b/src/map/atcommand.cindex 719b140..2b0770d 100644--- a/src/map/atcommand.c+++ b/src/map/atcommand.c@@ -64,7 +64,7 @@ struct atcmd_binding_data* get_atcommandbind_byname(const char* name) { if( *name == atcommand->at_symbol || *name == atcommand->char_symbol ) name++; // for backwards compatibility - ARR_FIND( 0, atcommand->binding_count, i, strcmp(atcommand->binding->command, name) == 0 );+ ARR_FIND( 0, atcommand->binding_count, i, strcmpi(atcommand->binding->command, name) == 0 ); return ( i < atcommand->binding_count ) ? atcommand->binding : NULL; }
Ind fixed strcmpi thing has some time already xD
We use essential cookies to make this site work, and optional cookies to enhance your experience.