Jump to content
  • 0

Guild of the Month Flag


Pink Guy

Question


  • Group:  Members
  • Topic Count:  131
  • Topics Per Day:  0.03
  • Content Count:  371
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

Can someone please make me a Guild of the Month Flag NPC. Instead of using Getcastlename or something or GID, can I just put a guild name there and put a getguildmaster command? Example guild name: Amateurs.

 

Here's the example I made:

 


gonryun,160,118,4    script    Guild of The Month    722,{
        mes "[Guild of the Month]";
        mes "The Guild of the Month is the ^ff0000"Amateurs"^000000 Guild";
        mes "Their Guild Master is ^FF0000" + GetGuildMaster + "^000000";
 
end;
 
}

Can someone please help me with this? Also, I wanna put the emblem thing :)

Edited by Instinct
Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  131
  • Topics Per Day:  0.03
  • Content Count:  371
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

Fixed it's just the server name has space.

Edited by Instinct
Link to comment
Share on other sites

  • 1

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

gonryun,160,118,4	script	Guild of The Month	722,{
	mes "[Guild of the Month]";
	mes "The Guild of the Month is the ^ff0000"+getguildname(.a)+"^000000 Guild";
	mes "Their Guild Master is ^FF0000"+.b$+"^000000";
	close;

OnInit:
	set .guild$, "Amateurs";
	query_sql("SELECT `guild_id`,`master` FROM `guild` WHERE `name` = '"+.guild$+"';",.a,.b$);
	flagemblem .a;
}
Untested

Edit: Thank you for the example it made my job 100% easier. :)

Edited by Skorm
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  131
  • Topics Per Day:  0.03
  • Content Count:  371
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

I tested it but it's like this..

Is it because there's no "set .a" ? because I can see there's "set .guild$"

I7TnWtF.jpg

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

I tested it but it's like this..

Is it because there's no "set .a" ? because I can see there's "set .guild$"

It worked fine for me?

Hey, are you using an sql server? If not then this script won't work for you and I'll have to do something different using the guild ID instead of the guild name. If you are using an sql server make sure that the guild name is spelled exactly as it appears in your database.

13448075.png

Edited by Skorm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  308
  • Reputation:   3
  • Joined:  12/18/11
  • Last Seen:  

try this:

 

gonryun,160,118,4    script    Guild of The Month    722,{
    mes "[Guild of the Month]";
    mes "The Guild of the Month is the ^ff0000"+getguildname(.a)+"^000000 Guild";
    mes "Their Guild Master is ^FF0000"+.b$+"^000000";
    close;

OnInit:
    set .guild$, "+getguildname(.a)+";
    query_sql("SELECT `guild_id`,`master` FROM `guild` WHERE `name` = '"+.guild$+"';",.a,.b$);
    flagemblem .a;
}

 

if not working make an sql query which getting the name of the guild of the month

Edited by Capuche
BBCode
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  131
  • Topics Per Day:  0.03
  • Content Count:  371
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

Skorm, on 02 Jul 2013 - 17:11, said:

Instinct, on 02 Jul 2013 - 15:21, said:

I tested it but it's like this..

Is it because there's no "set .a" ? because I can see there's "set .guild$"

It worked fine for me?

Hey, are you using an sql server? If not then this script won't work for you and I'll have to do something different using the guild ID instead of the guild name. If you are using an sql server make sure that the guild name is spelled exactly as it appears in your database.

13448075.png

Thanks! I realized I was using txt server lol.

Btw, can someone help me with the emblem thing? It only appears when you @reloadscript and after @refresh / log out or anything, you can't see the emblem anymore.. can someone help?

Edited by Instinct
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Firstly I strongly recommend switching to an SQL server.

gonryun,160,118,4	script	Guild of The Month	722,{

mes "[Guild of the Month]";

mes "The Guild of the Month is the ^ff0000"+getguildname(.guild_id)+"^000000 Guild";

mes "Their Guild Master is ^FF0000"+getguildmaster(.guild_id)+"^000000";

close;

OnInit:

set .guild_id, 1;

flagemblem .guild_id;

}

I can't really think of a way to return the guild_id using guild name on a txt server. :/ Perhaps someone else has more insight on this, but you can use the guilds ID here and it will work on a txt server.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  131
  • Topics Per Day:  0.03
  • Content Count:  371
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

I used an SQL server and it works but the thing is, the emblem disappears if you walk away/@refresh/relog. So is there any way to make the emblem appear permanently?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

I used an SQL server and it works but the thing is, the emblem disappears if you walk away/@refresh/relog. So is there any way to make the emblem appear permanently?

I don't seem to have this problem the method used by all flags is relatively similar to what I've done here. You could try reloading the image with Ontouch but that might get a little bad with people walking through it and stuff.

If you've just reloaded scripts and are refreshing the map I recommend doing a full server restart and seeing how it works for you then because sometimes @reloadscript is a little buggy.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

I used an SQL server and it works but the thing is, the emblem disappears if you walk away/@refresh/relog. So is there any way to make the emblem appear permanently?

show your script .... emblem that display on flag will only clear after server reboot / reloaded ...depend on what type of variable you used to store the char id ...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  131
  • Topics Per Day:  0.03
  • Content Count:  371
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

I used the script above provided by Skorm. I made the guild called "Amateurs" and it works fine but after I type @refresh, the emblem disappears but I'll try to restart the server and see.



I restarted the server and it still disappears. Anyone can help me?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...