ProjectX Posted April 4, 2023 Posted April 4, 2023 - script atcmd_noitem -1,{ OnInit: bindatcmd("item",strnpcinfo(3)+"::OnAtcommand",0,99); setarray .item_restrict,7227,607; end; OnAtcommand: .@itemid = atoi(.@atcmd_parameters$[0]); if(!getgmlevel()){ if(inarray(.item_restrict,.@itemid) != -1){ message strcharinfo(0),"You cannot create this item."; end; } } if(getitemname(.@itemid) != "null"){ .@quantity = atoi( .@atcmd_parameters$[1] ); if ( .@quantity < 1 ) .@quantity = 1; getitem .@itemid,.@quantity; } end; } HELLO TO SCRIPTER. I WOULD LIKE TO REQUEST . IF THE PLAYERS IS LVL 99 HE CAN USE THIS COMMAND. AND IF THE PLAYER 99 BELOW HE CANT USE THIS COMMAND. THANK YOU . Quote
0 hendra814 Posted April 4, 2023 Posted April 4, 2023 34 minutes ago, Racaae said: Hi, Find this line: mes "Only for character with level 99 and above"; Change to: else mes "Only for character with level 99 and above"; Thanks it's working now - script atcmd_noitem -1,{ OnInit: bindatcmd("getitem",strnpcinfo(3)+"::OnAtcommand"); setarray .item_restrict,7227,607; end; OnAtcommand: if (baselevel >= 99){ .@itemid = atoi(.@atcmd_parameters$[0]); if(!getgmlevel()){ if(inarray(.item_restrict,.@itemid) != -1){ message strcharinfo(0),"You cannot create this item."; end; } } if(getitemname(.@itemid) != "null"){ .@quantity = atoi( .@atcmd_parameters$[1] ); if ( .@quantity < 1 ) .@quantity = 1; getitem .@itemid,.@quantity; } } else mes "Only for character with level 99 and above"; end; } it's so powerful command, can by pass for create any item for non GM user. change into @getitem command, but using @item still can create any items Quote
0 Slur Posted April 4, 2023 Posted April 4, 2023 if(BaseLevel < 99){ bindatcmd("item",strnpcinfo(3)+"::OnAtcommand"); }end; im not a good at script but try if its working.. Quote
0 hendra814 Posted April 4, 2023 Posted April 4, 2023 (edited) 12 hours ago, ProjectX said: - script atcmd_noitem -1,{ OnInit: bindatcmd("item",strnpcinfo(3)+"::OnAtcommand",0,99); setarray .item_restrict,7227,607; end; OnAtcommand: .@itemid = atoi(.@atcmd_parameters$[0]); if(!getgmlevel()){ if(inarray(.item_restrict,.@itemid) != -1){ message strcharinfo(0),"You cannot create this item."; end; } } if(getitemname(.@itemid) != "null"){ .@quantity = atoi( .@atcmd_parameters$[1] ); if ( .@quantity < 1 ) .@quantity = 1; getitem .@itemid,.@quantity; } end; } HELLO TO SCRIPTER. I WOULD LIKE TO REQUEST . IF THE PLAYERS IS LVL 99 HE CAN USE THIS COMMAND. AND IF THE PLAYER 99 BELOW HE CANT USE THIS COMMAND. THANK YOU . try this - script atcmd_noitem -1,{ OnInit: bindatcmd("item",strnpcinfo(3)+"::OnAtcommand"); setarray .item_restrict,7227,607; end; OnAtcommand: if (baselevel >= 99){ .@itemid = atoi(.@atcmd_parameters$[0]); if(!getgmlevel()){ if(inarray(.item_restrict,.@itemid) != -1){ message strcharinfo(0),"You cannot create this item."; end; } } if(getitemname(.@itemid) != "null"){ .@quantity = atoi( .@atcmd_parameters$[1] ); if ( .@quantity < 1 ) .@quantity = 1; getitem .@itemid,.@quantity; } } mes "Only for character with level 99 and above"; end; } Edited April 4, 2023 by hendra814 Quote
0 ProjectX Posted April 4, 2023 Author Posted April 4, 2023 1 hour ago, hendra814 said: try this OnInit: bindatcmd("item",strnpcinfo(3)+"::OnAtcommand"); setarray .item_restrict,7227,607; end; OnAtcommand: if (baselevel >= 99){ .@itemid = atoi(.@atcmd_parameters$[0]); if(!getgmlevel()){ if(inarray(.item_restrict,.@itemid) != -1){ message strcharinfo(0),"You cannot create this item."; end; } } if(getitemname(.@itemid) != "null"){ .@quantity = atoi( .@atcmd_parameters$[1] ); if ( .@quantity < 1 ) .@quantity = 1; getitem .@itemid,.@quantity; } } mes "Only for character with level 99 and above"; end; } when i use this command. There were still items after using the un command. Quote
0 hendra814 Posted April 4, 2023 Posted April 4, 2023 (edited) Sorry i didn't test the script, i will inform you later when i'm back home. Edit: already test the script, it's weird can't run as requested, don't know where the problem, maybe need someone to fix it. baselevel more than 99 and below 99 always show the same result. Edited April 4, 2023 by hendra814 Quote
0 Racaae Posted April 4, 2023 Posted April 4, 2023 8 hours ago, ProjectX said: when i use this command. There were still items after using the un command. Hi, Find this line: mes "Only for character with level 99 and above"; Change to: else mes "Only for character with level 99 and above"; Quote
0 ProjectX Posted April 5, 2023 Author Posted April 5, 2023 15 hours ago, hendra814 said: Thanks it's working now - script atcmd_noitem -1,{ OnInit: bindatcmd("getitem",strnpcinfo(3)+"::OnAtcommand"); setarray .item_restrict,7227,607; end; OnAtcommand: if (baselevel >= 99){ .@itemid = atoi(.@atcmd_parameters$[0]); if(!getgmlevel()){ if(inarray(.item_restrict,.@itemid) != -1){ message strcharinfo(0),"You cannot create this item."; end; } } if(getitemname(.@itemid) != "null"){ .@quantity = atoi( .@atcmd_parameters$[1] ); if ( .@quantity < 1 ) .@quantity = 1; getitem .@itemid,.@quantity; } } else mes "Only for character with level 99 and above"; end; } it's so powerful command, can by pass for create any item for non GM user. change into @getitem command, but using @item still can create any items thank you very much idol. is now working Quote
Question
ProjectX
- script atcmd_noitem -1,{ OnInit: bindatcmd("item",strnpcinfo(3)+"::OnAtcommand",0,99); setarray .item_restrict,7227,607; end; OnAtcommand: .@itemid = atoi(.@atcmd_parameters$[0]); if(!getgmlevel()){ if(inarray(.item_restrict,.@itemid) != -1){ message strcharinfo(0),"You cannot create this item."; end; } } if(getitemname(.@itemid) != "null"){ .@quantity = atoi( .@atcmd_parameters$[1] ); if ( .@quantity < 1 ) .@quantity = 1; getitem .@itemid,.@quantity; } end; }
HELLO TO SCRIPTER. I WOULD LIKE TO REQUEST . IF THE PLAYERS IS LVL 99 HE CAN USE THIS COMMAND. AND IF THE PLAYER 99 BELOW HE CANT USE THIS COMMAND.
THANK YOU .
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.