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;
}