Jump to content

Epsynus

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Sweden

Epsynus's Achievements

Poring

Poring (1/15)

1

Reputation

  1. Alright people I am having some issues understanding the syntax for query_sql what I am trying to achieve is to delete the character through a script, and the following are the ways I have tried doing it so far. any help is appriciated and of course I will pay back to the community with my knowledge! - script game_mechanics -1,{ OnPCDieEvent: set #id,getcharid(0); //get their character ID announce strcharinfo(0) +" was killed by "+ rid2name(killerrid),0xFFFF00; atcommand "@kick "+#id; //ways I have tried so far //query_sql("DELETE FROM char WHERE char_id='"+escape_sql(#id)+"'"); //query_sql("DELETE FROM char WHERE char_id='"+getcharid(0)+"'"); query_sql("DELETE FROM 'char' WHERE 'char_id' = '"+getcharid(0)+"' "); end; //query_sql from other scripts to help me. //query_sql("UPDATE `char` SET `pvp_exp` = `pvp_exp`+100 WHERE `char_id` = '"+getcharid(0)+"' "); //query_sql ("DELETE FROM bountys WHERE name='"+escape_sql(@name2$)+"'"); //query_sql ("UPDATE bountyladder SET target3='"+@name$+"' WHERE char_id="+getcharid(0)+""); } all of them produces a simple error [sql]: DB error - You have an error in your SQL syntax; check the manual that co rresponds to your MySQL server version for the right syntax to use near ''char' WHERE 'char_id' = '150000'' at line 1 [Debug]: at c:\kinbel\src\map\script.c:13127 - DELETE FROM 'char' WHERE 'char_id ' = '150000' [Debug]: Source (NPC): game_mechanics (invisible/not on a map) EDIT: okay so I tried this new syntax and now I get a new error which I am not quite sure why I am getting it. [sql]: DB error - Unknown column '150000' in 'where clause' [Debug]: at c:\kinbel\src\map\script.c:13127 - DELETE FROM `char` WHERE `char_id `=`150000` [Debug]: Source (NPC): game_mechanics (invisible/not on a map) The new syntax is query_sql("DELETE FROM `char` WHERE `char_id`=`"+getcharid(0)+"` "); EDIT2: I solved it... I feel very..very...very stupid.
  2. I was thinking of something along the lines of doing that but I am not too sure if it would work out the way I would want to. As I am not sure about the syntax of the query_sql. As I cooked up this concept script but the syntax is off (as a keen eye can see it is originally from a php script.. whiiiich is a tad different from the scripting engine ) anyways if anyone has any pointers to maybe doing it with a script here is the make-shift script I made. http://pastebin.com/YGjwsBcW Note: I am not intending to be hand-held with this just some pointers and a little help will do fine. afterall, I'm trying to learn from it too! note for mods: I know this is the section for source help and not for scripts. But since it was relevant I posted my script here, the main point of the topic is still about the source. EDIT: It seems to be unable to process anything but a SELECT query. still trying to solve a source mod for it. EDIT2: I was stupid.. I solved it.
  3. Hello there people of rAthena, I am interested in modifiying the source code so that as soon as a person dies they do not have the option of respawning but instead they get kicked out and their character get's permanently deleted. MMO on a hardcore level. anyways I have tried to call the deletion process in char.c int delete_char_sql(int char_id) { ........ right in the code where they die, in pc.c int pc_dead(struct map_session_data *sd,struct block_list *src) { ....... but I realized quite quickly that that won't work due to them being seperate files and not linked together, then I thought about linking them together with a simple #include buut I realized that it will break with that too! with even more errors that time around. So if anyone has any pointers to how this could be solved please do feel free to reply Thanks for taking your time to reply with your take on this.
×
×
  • Create New...