Jump to content
  • 0

Perm nuke script


Hirasu

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  61
  • Reputation:   6
  • Joined:  12/23/11
  • Last Seen:  

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.
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  61
  • Reputation:   6
  • Joined:  12/23/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Miss one bracket sorry !

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  61
  • Reputation:   6
  • Joined:  12/23/11
  • Last Seen:  

dont work now the script do nothing but say (player found)

Link to comment
Share on other sites

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.

×
×
  • Create New...