Hey hi, I used some scripts in the past that checks for players on a map. ie; map shower, maprecall custom script. It was working before, but for some reason it's not working anymore. It would output "0 players detected" even if there are players on the map.
Can someone please help me make these scripts work again please?
maprecall script :
- script atcmd_examplere -1,{
OnInit:
bindatcmd "recallmap",strnpcinfo(3)+"::OnAtcommand",60,60;
end;
OnAtcommand:
getmapxy .map_self$, .x_self, .y_self, 0;
.myname$ = strcharinfo(0);
.count = 0;
addrid 0;
if ( strcharinfo(3) == .map_self$ && strcharinfo(0) != .myname$ ) {
message strcharinfo(0), "You have been recalled by "+ .myname$ +".";
warp .map_self$, .x_self, .y_self;
.count++;
}
if ( strcharinfo(0) != .myname$ ) end;
sleep2 10;
if ( .count == 0 )
message strcharinfo(0), "There's no player on this map except you.";
else
message strcharinfo(0), .count +" player(s) recalled.";
end;
}
and my shower script only the map option is not working:
Hey hi, I used some scripts in the past that checks for players on a map. ie; map shower, maprecall custom script. It was working before, but for some reason it's not working anymore. It would output "0 players detected" even if there are players on the map.
Can someone please help me make these scripts work again please?
maprecall script :
- script atcmd_examplere -1,{ OnInit: bindatcmd "recallmap",strnpcinfo(3)+"::OnAtcommand",60,60; end; OnAtcommand: getmapxy .map_self$, .x_self, .y_self, 0; .myname$ = strcharinfo(0); .count = 0; addrid 0; if ( strcharinfo(3) == .map_self$ && strcharinfo(0) != .myname$ ) { message strcharinfo(0), "You have been recalled by "+ .myname$ +"."; warp .map_self$, .x_self, .y_self; .count++; } if ( strcharinfo(0) != .myname$ ) end; sleep2 10; if ( .count == 0 ) message strcharinfo(0), "There's no player on this map except you."; else message strcharinfo(0), .count +" player(s) recalled."; end; }and my shower script only the map option is not working:
// usage : // [npc:Sample]map#512#10 // [npc:Sample]all#512#123 - script shower -1,{ OnWhisperGlobal: if( getgmlevel() >= 99 ){ // check map if( @whispervar0$ == "all" ) set [email protected]$,""; else if( @whispervar0$ == "map" ) set [email protected]$,strcharinfo(3); else { dispbottom "Error: all#512#123"; end; } // check item set [email protected],atoi( @whispervar1$ ); set [email protected],atoi( @whispervar2$ ); if( getitemname( [email protected] ) == "null" || [email protected] < 1 ){ dispbottom "Enter valid item id and amount."; } set [email protected]_id,getcharid(3); query_sql( "SELECT COUNT(`account_id`) FROM `char` WHERE `online` = 1 ", [email protected] ); while( [email protected] < [email protected] ){ query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 ORDER BY `account_id` LIMIT 128 OFFSET "[email protected], [email protected],[email protected]$ ); set [email protected],0; set [email protected],getarraysize( [email protected] ); while( [email protected] < [email protected] ){ if( [email protected][[email protected]] != [email protected]_id ){ if( [email protected]$ != "" ){ getmapxy( [email protected]$,[email protected],[email protected],0,[email protected]$[[email protected]] ); if( [email protected]$ == [email protected]$ ){ getitem [email protected],[email protected],[email protected][[email protected]]; set [email protected],[email protected] + 1; } }else{ getitem [email protected],[email protected],[email protected][[email protected]]; set [email protected],[email protected] + 1; } } set [email protected],[email protected] + 1; set [email protected],[email protected] + 1; } set [email protected],[email protected] + [email protected]; deletearray [email protected],[email protected]; deletearray [email protected]$,[email protected]; } dispbottom "Gave "[email protected]+" x "+getitemname( [email protected] )+" to "[email protected]+" Player(s)."; } end; }Both scripts was working back then but doesn't work anymore. Thank you for the help.
Link to comment
Share on other sites