Hirasu Posted January 17, 2013 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 61 Reputation: 6 Joined: 12/23/11 Last Seen: November 17, 2021 Share Posted January 17, 2013 (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 ? - 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 January 17, 2013 by Euphy Codeboxed. Quote Link to comment Share on other sites More sharing options...
Capuche Posted January 17, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted January 17, 2013 (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 January 17, 2013 by Capuche Quote Link to comment Share on other sites More sharing options...
Hirasu Posted January 17, 2013 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 61 Reputation: 6 Joined: 12/23/11 Last Seen: November 17, 2021 Author Share Posted January 17, 2013 (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 January 17, 2013 by Hirasu Quote Link to comment Share on other sites More sharing options...
Capuche Posted January 17, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted January 17, 2013 Miss one bracket sorry ! Quote Link to comment Share on other sites More sharing options...
Hirasu Posted January 17, 2013 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 61 Reputation: 6 Joined: 12/23/11 Last Seen: November 17, 2021 Author Share Posted January 17, 2013 dont work now the script do nothing but say (player found) Quote Link to comment Share on other sites More sharing options...
Question
Hirasu
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 ?
Edited by EuphyCodeboxed.
Link to comment
Share on other sites
4 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.