caspa Posted June 2, 2013 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Share Posted June 2, 2013 i got error on this part. Quote Link to comment Share on other sites More sharing options...
Jaburak Posted June 3, 2013 Group: Members Topic Count: 48 Topics Per Day: 0.01 Content Count: 1125 Reputation: 236 Joined: 07/30/12 Last Seen: April 13 Share Posted June 3, 2013 This is absolutely wrong. SELECT `name` FROM `guild` WHERE `name` Quote Link to comment Share on other sites More sharing options...
DeadlySilence Posted June 3, 2013 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 181 Reputation: 53 Joined: 04/07/13 Last Seen: August 23, 2014 Share Posted June 3, 2013 It is not an error, just a warning because you read one column from the database without saving it to a variable. Thus, the script warns you that you don't do anything with the variable. Quote Link to comment Share on other sites More sharing options...
caspa Posted June 3, 2013 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Author Share Posted June 3, 2013 how to solve it? Quote Link to comment Share on other sites More sharing options...
DeadlySilence Posted June 3, 2013 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 181 Reputation: 53 Joined: 04/07/13 Last Seen: August 23, 2014 Share Posted June 3, 2013 Change your query to query_sql("<your query>", .@name$). Quote Link to comment Share on other sites More sharing options...
caspa Posted June 3, 2013 Group: Members Topic Count: 194 Topics Per Day: 0.04 Content Count: 499 Reputation: 3 Joined: 03/11/12 Last Seen: September 18, 2023 Author Share Posted June 3, 2013 (edited) i don't know how to properly do it...here's my script zhakastia,92,56,4 script Guild Manager 81,{ set .item1, 714; // Item ID 1 set .item2, 677; // Item ID 2 set .itemreq1, 9; // Ammount of item number 1 (9 since an emp is also consumed naturally upon guild creation) set .itemreq2, 10; // Ammount of item number 2 set .name$, "[^FF0000Guild Manager^000000]"; mes .name$; mes "Hello there "+strcharinfo(0)+"."; mes "I can help you form a guild or disband your current one."; menu "Sign-up for Guild Creation.",L_create,"Disband Guild.",L_disband,"Any requirements?",L_req,"No thanks.",L_cya; L_create: if(getpartyleader(getcharid(1)) == strcharinfo(0)) && (getcharid(2) == 0) { goto L_approve; } else { goto L_inguild; end; } L_approve: next; mes .name$; mes "Alright, I need you to tell me the name you want for your guild."; sleep2 1500; input @gcreatenm$; mes "Are you sure that's what you want?"; switch(select("Yes:No")) { case1: if ( query_sql ( "SELECT `name` FROM `guild` WHERE `name` = '"+escape_sql( @gcreatenm$ )+"'" ) ){ mes .name$; mes "'^ff0000"+@gcreatenm$+"^000000' has already been used."; mes "Please try another one."; next; goto L_create; end; } if(countitem(.item1) < .itemreq1) && (countitem(.item2) < .itemreq2) { goto L_nope; end; } mes .name$; mes "Alright then let's try this..."; atcommand "@guild "+@gcreatenm$; next; if(getcharid(2) == 0) { mes "Woops, seems like that guild already exists...try another name."; goto L_create; end; } announce strcharinfo(0)+" has created "+strcharinfo(2)+" Guild!",0; mes .name$; mes "Congrats."; delitem .item1, .itemreq1; delitem .item2, .itemreq2; close; end; case2: goto L_create; end; } L_disband: if(getcharid(2) == 0) { goto L_noguild; end; } if(getguildmaster(getcharid(2)) == strcharinfo(0)) { next; mes .name$; mes "Type this:"; mes "/breakguild ''"+strcharinfo(2)+"''"; close; end; } else { mes .name$; mes "You're not the guild leader."; close; end; } L_req: next; mes .name$; mes "You'll need "+.itemreq1+" pieces of "+getitemname(.item1)+" and "+.itemreq2+" pieces of "+getitemname(.item2)+"."; close; end; L_nope: next; mes .name$; mes "Bring me the items first!"; close; L_inguild: next; mes .name$; mes "You're either already in a guild or you're not the party leader!"; close; L_noguild: next; mes .name$; mes "You're not even in a guild!"; close; L_cya: next; mes .name$; mes "Next time then!"; close; } Edited June 3, 2013 by caspa Quote Link to comment Share on other sites More sharing options...
Emistry Posted June 3, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted June 3, 2013 you can also do like this if not mistaken .. SELECT 1 FROM `guild` WHERE `name` but still i believe add the part that save it into a variable would be better. Quote Link to comment Share on other sites More sharing options...
1 Capuche Posted June 3, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted June 3, 2013 if ( query_sql ( "SELECT 1 FROM `guild` WHERE `name` = '"+escape_sql( @gcreatenm$ )+"'", .@tmp ) ){ Quote Link to comment Share on other sites More sharing options...
Question
caspa
i got error on this part.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.