Jump to content
  • 0

Perm nuke script


Question

Posted (edited)

hi,

i need helpp with my script

he should perm nuked the target in the list but my script nuked the target one time not more :(

and i get this error in the console : buildin_rid2name: invalid RID

can someone fix this for me please ? /lv

-    script    NukeCola    -1,{
   OnInit:
       set .masterId,2000133;
       setarray .permitted[0],2000000;

       if(getarraysize($toNuke)>0) initnpctimer;
   end;

   OnTimer10000:
       for(set .@i,0; .@i < getarraysize($toNuke); set .@i,.@i+1) {
           set .@target$,rid2name($toNuke[.@i]);
           if(.@target$!="(null)") {
               attachrid($toNuke[.@i]);
               atcommand "@nuke "+.@target$;
               detachrid;
           }
       }

       initnpctimer;
   end;

   OnWhisperGlobal:
       callsub isNukePermitted;

       if(@whispervar0$=="nuke") {
           callsub addToNukeList,@whispervar1$;
           dispbottom "The target "+@whispervar1$+" wasn't found.";
       } else if(@whispervar0$=="nukelist") {
           if(getarraysize($toNuke)==0) {
               dispbottom "The nukelist is empty.";
               end;
           }

           for(set .@i,0; .@i < getarraysize($toNuke); set .@i,.@i+1) {
               set .@target$,rid2name($toNuke[.@i]);
               if(.@target$!="(null)")
                   dispbottom .@target$;
           }
       } else if(@whispervar0$=="unnuke") {
           callsub deleteFromNukeList,@whispervar1$;
           dispbottom "The target "+@whispervar1$+" wasn't found.";
       } else if(@whispervar0$=="help") {
           dispbottom "nuke#username";
           dispbottom "nukelist";
           dispbottom "unnuke#username";
       } else
           dispbottom @whispervar0$+"  is a unknown command.";
   end;

   deleteFromNukeList:
       for(set .@i,0; .@i < getarraysize($toNuke); set .@i,.@i+1) {
           if($toNuke[.@i]==getcharid(3,getarg(0))) {
               if(getcharid(3)!=.masterId) {
                   for(set .@y,0; .@y < getarraysize(.permitted); set .@y,.@y+1) {
                       if($toNuke[.@i]==.permitted[.@y]) {
                           dispbottom "Nice try again <3";
                           return 0;
                       }
                   }
               }

               set $toNuke[.@i],0;
               dispbottom @whispervar1$+" deleted from nukelist.";

               if(getarraysize($toNuke)==0) {
                   stopnpctimer;
                   setnpctimer 0;
               }
               end;
           }
       }
       return 0;
   end;

   addToNukeList:
       set .@target,getcharid(3,getarg(0));
       if(.@target==0) return 0;

       if(.@target==getcharid(3)) {
           dispbottom "You can't nuke yourself";
           end;
       }

       if(.@target==.masterId) {
           dispbottom "Nice try ;D";
           set .@target,getcharid(3);
       }

       set $toNuke[getarraysize($toNuke)],.@target;
       dispbottom @whispervar1$+" found.";

       if(getarraysize($toNuke)>=0) initnpctimer;
   end;

   isNukePermitted:
       for(set .@i,0; .@i < getarraysize(.permitted); set .@i,.@i+1)
           if(getcharid(3)==.permitted[.@i]) return 1;
   end;
}

Edited by Euphy
Codeboxed.

4 answers to this question

Recommended Posts

Posted (edited)

Use

if( isloggedin( $toNuke[.@i] ) {

if( isloggedin( $toNuke[.@i] ) ) {

before

  	 set .@target$,rid2name($toNuke[.@i]);
	if(.@target$!="(null)") {

( then you cand remove if(.@target$!="(null)") { )

Edited by Capuche
Posted (edited)

i get error

parse_simpleexpr: unmatch ')'

25 : if(getarraysize($toNuke)>0) initnpctimer;

26 : end;

27 :

28 : OnTimer10000:

29 : for(set .@i,0; .@i < getarraysize($toNuke); set .@i,.@i+1) {

* 30 : if( isloggedin( $toNuke[.@i] ) '{'

31 : attachrid($toNuke[.@i]);

32 : atcommand "@nuke "+.@target$;

33 : detachrid;

34 : }

35 : }

EDIT: one ")" missing

Edited by Hirasu

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...