Jump to content

Kid BaKa

Members
  • Content Count

    33
  • Joined

  • Last visited


Reputation Activity

  1. Upvote
    Kid BaKa reacted to AnnieRuru in how to make list ID for mob ?   
    if you consider using SQL, then it is pretty neat
    prontera,155,189,5 script kshdfksjdf 1_F_MARIA,{ mes "input a mob ID"; mes "if your inputed mob ID is a non-aggresive mob, I'll say 'OK'"; next; input .@id, 1000, 5000; if ( query_sql( "select 1 from mob_db where mode & 0x4 = 0 and id = "+ .@id, .@dummy ) ) mes "OK"; else mes "bleh"; close;}otherwise if your list is custom made, then have to loop the arrayprontera,155,189,5 script kshdfksjdf 1_F_MARIA,{ mes "input a mob ID"; mes "if your inputed mob ID is a non-aggresive mob, I'll say 'OK'"; next; input .@id, 1000, 5000; while ( .mob_id[.@i] != .@id && .@i < .mob_size ) .@i++; if ( .@i < .mob_size ) mes "OK"; else mes "bleh"; close;OnInit: .mob_size = query_sql( "select ID from mob_db where mode & 0x4 = 0", .mob_id ); // change this to your setarray end;}but it seems you got your own ID, then have to loop it
  2. Upvote
    Kid BaKa reacted to AnnieRuru in how to make list ID for mob ?   
    while ( compare the value && loop until last index ) .@i++;if ( .@i < last index ) <is in the array>;actually that's my trickthere's a flaw in this method because if the value is not in the array,
    it will compare 1 extra time, and possibly throw error on certain script commands
    like *getmonsterinfo
     
    its better to do the actual way
    for ( .@i = 0; .@i < .max_value; ++.@i ) if ( .mob_id[.@i] == .@id ) break;if ( .@i < .max_value ) <is in the array>;never have problem with this one 
    well .. what you are asking ... better ask google XD
    https://www.codecademy.com/forum_questions/510e3c1a3011b8fa25005255
    ... try google more
     
    =================================
     
    btw that query has more than 400 results, so player might summon .... event mobs for example
  3. Upvote
    Kid BaKa reacted to Angelmelody in how I can add new gm command to my server   
    you can also use  bindatcmd  like this
    - script asdfjkl -1,{OnInit: bindatcmd "localrecall", strnpcinfo(0)+"::Onwarp",60,99; end;Onwarp: getmapxy(.@m$,.@x,.@y,0); mapwarp .@m$,.@m$,.@x,.@y; end;}
  4. Upvote
    Kid BaKa reacted to Garr in how I can add new gm command to my server   
    First, you need to add the actual code inside src/map/atcommand.c, along with adding command to the list in the bottom of it. Plugin is a good (and even better imo) alternative to editing src files. Then you recompile (or compile and activate plugin), and edit conf/groups.conf to make the command accessible by players/GMs. That's pretty much it.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.